From c90e431c635640505bbaea7a695571e4696cccb7 Mon Sep 17 00:00:00 2001 From: Ryc O'Chet Date: Mon, 28 May 2018 11:47:23 +0100 Subject: [PATCH] Expose Velocity().promise for use in Promise.all() etc Fixes #868 --- src/velocityFn.ts | 17 ++++----- test/src/4_Feature/Feature Promises.ts | 14 ++++++-- test/test.js | 50 ++++++++++++++++++++++++-- test/test.js.map | 2 +- velocity.d.ts | 22 ++++++++++-- velocity.es5.js | 15 ++++---- velocity.es5.js.map | 2 +- velocity.js | 15 ++++---- velocity.js.map | 2 +- 9 files changed, 101 insertions(+), 38 deletions(-) diff --git a/src/velocityFn.ts b/src/velocityFn.ts index 0e096977..a92a172d 100644 --- a/src/velocityFn.ts +++ b/src/velocityFn.ts @@ -9,8 +9,8 @@ // Typedefs import { AnimationCall, AnimationFlags, HTMLorSVGElement, Properties, StrictVelocityOptions, - VelocityElements, VelocityObjectArgs, VelocityOptions, VelocityPromise, VelocityProperty, - VelocityResult, + VelocityElements, VelocityExtended, VelocityObjectArgs, VelocityOptions, VelocityPromise, + VelocityProperty, VelocityResult, } from "./../velocity.d"; // Project @@ -174,22 +174,19 @@ export function Velocity(this: VelocityElements | void, ...argsList: any[]): Vel // Due to being an async call, they should be back to "normal" // before the .then() function gets called. resolver = (result: VelocityResult) => { - if (isVelocityResult(result)) { - const then = result && result.then; + if (isVelocityResult(result) && result.then) { + const then = result.then; - if (then) { - result.then = undefined; // Preserving enumeration etc - } + result.then = undefined; // Preserving enumeration etc resolve(result); - if (then) { - result.then = then; - } + result.then = then; } else { resolve(result); } }; }); if (elements) { + defineProperty(elements, "promise", promise); defineProperty(elements, "then", promise.then.bind(promise)); defineProperty(elements, "catch", promise.catch.bind(promise)); if ((promise as any).finally) { diff --git a/test/src/4_Feature/Feature Promises.ts b/test/src/4_Feature/Feature Promises.ts index 0ed94a03..64ee65b1 100644 --- a/test/src/4_Feature/Feature Promises.ts +++ b/test/src/4_Feature/Feature Promises.ts @@ -11,11 +11,11 @@ import {defaultOptions, defaultProperties, getNow, getTarget} from "../utilities import "./_module"; QUnit.test("Promises", (assert) => { - const done = assert.async(9), + const done = assert.async(10), start = getNow(); let result: VelocityResult; - assert.expect(9); + assert.expect(10); /********************** Invalid Arguments @@ -97,4 +97,14 @@ QUnit.test("Promises", (assert) => { }) .then(done); anim.velocity("stop"); + + Promise + .all([ + Velocity(getTarget(), defaultProperties, defaultOptions).promise, + Velocity(getTarget(), defaultProperties, defaultOptions).promise, + ]) + .then(() => { + assert.ok(true, "Promise.all fulfilled when all animations have finished."); + }) + .then(done); }); diff --git a/test/test.js b/test/test.js index 91b67825..9198620e 100644 --- a/test/test.js +++ b/test/test.js @@ -156,8 +156,10 @@ // $div2.velocity({paddingRight: 40}); // $div2.velocity({marginTop: 0}) // $div2.dequeue("test") + //# sourceMappingURL=utilities.js.map QUnit.module("Core"); + //# sourceMappingURL=_module.js.map var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; @@ -264,6 +266,7 @@ done(); }); }); + //# sourceMappingURL=End Value Caching.js.map QUnit.test("End Value Setting", function (assert) { var done = assert.async(1); @@ -274,6 +277,7 @@ done(); }); }); + //# sourceMappingURL=End Value Setting.js.map QUnit.todo("Start Value Calculation", function (assert) { var testStartValues = { @@ -346,6 +350,7 @@ Velocity($target5, testPropertiesTRBL); assert.equal(parseInt(Data($target5).cache.left, 10), Math.round(parseFloat(testPropertiesTRBL.left) + parseFloat(Velocity(document.body, "style", "marginLeft"))), "TRBL value was deferred to jQuery."); }); + //# sourceMappingURL=Start Value Calculation.js.map /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -495,8 +500,10 @@ })); }); }); + //# sourceMappingURL=Unit Calculation.js.map QUnit.module("Option"); + //# sourceMappingURL=_module.js.map QUnit.test("Begin", function (assert) { asyncTests(assert, 1, function (done) { @@ -511,6 +518,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Begin.js.map QUnit.test("Complete", function (assert) { asyncTests(assert, 1, function (done) { @@ -525,6 +533,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Complete.js.map QUnit.test("Delay", function (assert) { var testDelay = 250; @@ -555,6 +564,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Delay.js.map QUnit.test("Easing", function (assert) { asyncTests(assert, 1, function (done) { @@ -681,6 +691,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Easing.js.map var _this$1 = window; QUnit.test("FPS Limit", function (assert) { @@ -781,6 +792,7 @@ }, _callee, this, [[6, 23, 27, 35], [28,, 30, 34]]); })); }); + //# sourceMappingURL=Option Fps Limit.js.map QUnit.test("Loop", function (assert) { asyncTests(assert, 4, function (done) { @@ -816,6 +828,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Loop.js.map QUnit.test("Progress", function (assert) { asyncTests(assert, 4, function (done) { @@ -833,6 +846,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Progress.js.map QUnit.test("Queue", function (assert) { var done = assert.async(4), @@ -885,6 +899,7 @@ } }); }); + //# sourceMappingURL=Option Queue.js.map QUnit.test("Repeat", function (assert) { asyncTests(assert, 4, function (done) { @@ -917,6 +932,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Repeat.js.map QUnit.test("Speed", function (assert) { var delay = 200, @@ -1028,6 +1044,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Speed.js.map var _this$2 = window; QUnit.test("Sync", function (assert) { @@ -1103,8 +1120,10 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Option Sync.js.map QUnit.module("Command"); + //# sourceMappingURL=_module.js.map var _this$3 = window; QUnit.test("Finish", function (assert) { @@ -1279,6 +1298,7 @@ }, _callee5, this); })); }); + //# sourceMappingURL=Command Finish.js.map var _this$4 = window; QUnit.test("Pause + Resume", function (assert) { @@ -1467,6 +1487,7 @@ }, _callee5, this); })); }); + //# sourceMappingURL=Command Pause + Resume.js.map QUnit.test("Reverse", function (assert) { var $target = getTarget(), @@ -1503,6 +1524,7 @@ }); assert.expect(asyncTests()); }); + //# sourceMappingURL=Command Reverse.js.map /* Window scrolling. */ QUnit.skip("Scroll (Window)", function (assert) { @@ -1679,6 +1701,7 @@ // } // }); }); + //# sourceMappingURL=Command Scroll.js.map var _this$5 = window; QUnit.test("Stop", function (assert) { @@ -1884,6 +1907,7 @@ }, _callee6, this); })); }); + //# sourceMappingURL=Command Stop.js.map QUnit.test("Tween", function (assert) { var $target1 = getTarget(), @@ -1911,6 +1935,7 @@ }); QUnit.module("Feature"); + //# sourceMappingURL=_module.js.map QUnit.test("'velocity-animating' Classname", function (assert) { var done = assert.async(1); @@ -1923,6 +1948,7 @@ } }).then(done); }); + //# sourceMappingURL=Feature Classname.js.map QUnit.skip("Colors (Shorthands)", function (assert) { var $target = getTarget(); @@ -1938,6 +1964,7 @@ // assert.equal(Data($target).style.colorGreen.endValue, 125, "Hex #3b component."); // assert.equal(Data($target).style.colorBlue.endValue, 173, "Hex #3c component."); }); + //# sourceMappingURL=Feature Colors.js.map QUnit.todo("Forcefeeding", function (assert) { /* Note: Start values are always converted into pixels. W test the conversion ratio we already know to avoid additional work. */ @@ -1954,12 +1981,13 @@ assert.equal(Data($target).cache.height, parseFloat(testStartHeight), "Forcefed value #2 passed to tween."); assert.equal(Data($target).cache.opacity, defaultStyles.opacity, "Easing was misinterpreted as forcefed value."); }); + //# sourceMappingURL=Feature Forcefeeding.js.map QUnit.test("Promises", function (assert) { - var done = assert.async(9), + var done = assert.async(10), start = getNow(); var result = void 0; - assert.expect(9); + assert.expect(10); /********************** Invalid Arguments **********************/ @@ -2013,6 +2041,9 @@ assert.ok(false, "Stop call fulfilled after correct delay."); }).then(done); anim.velocity("stop"); + Promise.all([Velocity(getTarget(), defaultProperties, defaultOptions).promise, Velocity(getTarget(), defaultProperties, defaultOptions).promise]).then(function () { + assert.ok(true, "Promise.all fulfilled when all animations have finished."); + }).then(done); }); QUnit.todo("Sequences", function (assert) { @@ -2041,6 +2072,7 @@ // // Velocity([$target1, $target2], "test", redirectOptions); }); + //# sourceMappingURL=Feature Sequences.js.map QUnit.todo("Value Functions", function (assert) { var testWidth = 10, @@ -2054,8 +2086,10 @@ assert.equal(Data($target1).cache.width, parseFloat(testWidth) / 2, "Function value #1 passed to tween."); assert.equal(Data($target2).cache.width, parseFloat(testWidth), "Function value #2 passed to tween."); }); + //# sourceMappingURL=Feature Value Functions.js.map QUnit.module("UI Pack"); + //# sourceMappingURL=_module.js.map QUnit.skip("Packaged Effect: slideUp/Down", function (assert) { var done = assert.async(4), @@ -2094,6 +2128,7 @@ } }); }); + //# sourceMappingURL=Packaged Effect slideUp+Down.js.map QUnit.skip("Call Options", function (assert) { var done = assert.async(2), @@ -2126,6 +2161,7 @@ done(); }, completeCheckDuration); }); + //# sourceMappingURL=UI Pack Call Options.js.map QUnit.skip("Callbacks", function (assert) { var done = assert.async(2), @@ -2142,6 +2178,7 @@ } }); }); + //# sourceMappingURL=UI Pack Callbacks.js.map QUnit.skip("In/Out", function (assert) { var done = assert.async(2), @@ -2175,6 +2212,7 @@ done(); }, completeCheckDuration); }); + //# sourceMappingURL=UI Pack In+Out.js.map QUnit.skip("RegisterEffect", function (assert) { // const done = assert.async(1), @@ -2200,6 +2238,7 @@ // done(); // }, effectDefaultDuration * 1.5); }); + //# sourceMappingURL=UI Pack RegisterEffect.js.map QUnit.skip("RunSequence", function (assert) { // @@ -2228,8 +2267,10 @@ // assert.expect(3); // Velocity.RunSequence(mySequence); }); + //# sourceMappingURL=UI Pack RunSequence.js.map QUnit.module("Properties"); + //# sourceMappingURL=_module.js.map QUnit.skip("GenericReordering", function (assert) { // function genericReordering(element: HTMLorSVGElement, propertyValue?: string): string | void { @@ -2297,6 +2338,7 @@ // assert.equal(element.velocity("style", "genericReordering"), test.result, test.test); // } }); + //# sourceMappingURL=Normalization property value reordering.js.map QUnit.test("Display", function (assert) { var done = assert.async(5); @@ -2325,6 +2367,7 @@ done(); }); }); + //# sourceMappingURL=Property Display.js.map QUnit.test("Visibility", function (assert) { var done = assert.async(4); @@ -2350,6 +2393,9 @@ done(); }); }); + //# sourceMappingURL=Property Visibility.js.map + + //# sourceMappingURL=test.js.map }))); //# sourceMappingURL=test.js.map diff --git a/test/test.js.map b/test/test.js.map index b34f44e0..7f98139f 100644 --- a/test/test.js.map +++ b/test/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sources":["src/utilities.ts","src/1_Core/_module.ts","src/1_Core/Arguments.ts","src/1_Core/End Value Caching.ts","src/1_Core/End Value Setting.ts","src/1_Core/Start Value Calculation.ts","src/1_Core/Unit Calculation.ts","src/2_Option/_module.ts","src/2_Option/Option Begin.ts","src/2_Option/Option Complete.ts","src/2_Option/Option Delay.ts","src/2_Option/Option Easing.ts","src/2_Option/Option Fps Limit.ts","src/2_Option/Option Loop.ts","src/2_Option/Option Progress.ts","src/2_Option/Option Queue.ts","src/2_Option/Option Repeat.ts","src/2_Option/Option Speed.ts","src/2_Option/Option Sync.ts","src/3_Command/_module.ts","src/3_Command/Command Finish.ts","src/3_Command/Command Pause + Resume.ts","src/3_Command/Command Reverse.ts","src/3_Command/Command Scroll.ts","src/3_Command/Command Stop.ts","src/3_Command/Command Tween.ts","src/4_Feature/_module.ts","src/4_Feature/Feature Classname.ts","src/4_Feature/Feature Colors.ts","src/4_Feature/Feature Forcefeeding.ts","src/4_Feature/Feature Promises.ts","src/4_Feature/Feature Sequences.ts","src/4_Feature/Feature Value Functions.ts","src/5_UIPack/_module.ts","src/5_UIPack/Packaged Effect slideUp+Down.ts","src/5_UIPack/UI Pack Call Options.ts","src/5_UIPack/UI Pack Callbacks.ts","src/5_UIPack/UI Pack In+Out.ts","src/5_UIPack/UI Pack RegisterEffect.ts","src/5_UIPack/UI Pack RunSequence.ts","src/6_Properties/_module.ts","src/6_Properties/Normalization property value reordering.ts","src/6_Properties/Property Display.ts","src/6_Properties/Property Visibility.ts"],"sourcesContent":["/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {ElementData, VelocityOptions, VelocityProperties} from \"velocity-animate\";\r\n\r\ndeclare global {\r\n\tinterface QUnit {\r\n\t\ttodo(name: string, callback: (assert: Assert) => void): void;\r\n\t}\r\n\r\n\tinterface Assert {\r\n\t\tclose: {\r\n\t\t\t(actual: number, expected: number, maxDifference: number, message: string): void;\r\n\t\t\tpercent(actual: number, expected: number, maxPercentDifference: number, message: string): void;\r\n\t\t};\r\n\t\tnotClose: {\r\n\t\t\t(actual: number, expected: number, minDifference: number, message: string): void;\r\n\t\t\tpercent(actual: number, expected: number, minPercentDifference: number, message: string): void;\r\n\t\t};\r\n\t}\r\n}\r\n\r\nexport const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\r\n\tisAndroid = /Android/i.test(navigator.userAgent),\r\n\tdefaultStyles = {\r\n\t\topacity: 1,\r\n\t\twidth: 1,\r\n\t\theight: 1,\r\n\t\tmarginBottom: 1,\r\n\t\tcolorGreen: 200,\r\n\t\ttextShadowBlur: 3,\r\n\t},\r\n\tdefaultProperties: VelocityProperties = {\r\n\t\topacity: String(defaultStyles.opacity / 2),\r\n\t\twidth: defaultStyles.width * 2 + \"px\",\r\n\t\theight: defaultStyles.height * 2 + \"px\",\r\n\t},\r\n\tdefaultOptions: VelocityOptions = {\r\n\t\tqueue: \"\",\r\n\t\tduration: 300,\r\n\t\teasing: \"swing\",\r\n\t\tbegin: null,\r\n\t\tcomplete: null,\r\n\t\tprogress: null,\r\n\t\tloop: false,\r\n\t\tdelay: 0,\r\n\t\tmobileHA: true,\r\n\t},\r\n\t$ = ((window as any).jQuery || (window as any).Zepto),\r\n\t$qunitStage = document.getElementById(\"qunit-stage\"),\r\n\tasyncCheckDuration = (defaultOptions.duration as number) / 2,\r\n\tcompleteCheckDuration = (defaultOptions.duration as number) * 2,\r\n\tIE = (() => {\r\n\t\tif ((document as any).documentMode) {\r\n\t\t\treturn (document as any).documentMode as number;\r\n\t\t} else {\r\n\t\t\tfor (let i = 7; i > 0; i--) {\r\n\t\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\t\tdiv.innerHTML = ``;\r\n\t\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\t\tdiv = null;\r\n\r\n\t\t\t\t\treturn i;\r\n\t\t\t\t}\r\n\t\t\t\tdiv = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t})();\r\n\r\nconst targets: HTMLDivElement[] = [];\r\nlet asyncCount = 0;\r\n\r\nQUnit.config.reorder = false;\r\n\r\nexport function applyStartValues(element: HTMLElement, startValues: {[name: string]: string}) {\r\n\t$.each(startValues, (property, startValue) => {\r\n\t\telement.style[property] = startValue;\r\n\t});\r\n}\r\n\r\nexport function Data(element): ElementData {\r\n\treturn (element.jquery ? element[0] : element).velocityData;\r\n}\r\n\r\nexport function getNow(): number {\r\n\treturn performance && performance.now ? performance.now() : Date.now();\r\n}\r\n\r\nexport function getPropertyValue(element: HTMLElement, property: string): string {\r\n\treturn Velocity(element, \"style\", property);\r\n}\r\n\r\nexport function getTarget(startValues?: {[name: string]: string}): HTMLDivElement {\r\n\tconst div = document.createElement(\"div\") as HTMLDivElement;\r\n\r\n\tdiv.className = \"target\";\r\n\tdiv.style.opacity = String(defaultStyles.opacity);\r\n\tdiv.style.color = `rgb(125, ${defaultStyles.colorGreen}, 125)`;\r\n\tdiv.style.width = defaultStyles.width + \"px\";\r\n\tdiv.style.height = defaultStyles.height + \"px\";\r\n\tdiv.style.marginBottom = defaultStyles.marginBottom + \"px\";\r\n\tdiv.style.textShadow = `0px 0px ${defaultStyles.textShadowBlur}px red`;\r\n\t$qunitStage.appendChild(div);\r\n\ttargets.push(div);\r\n\tif (startValues) {\r\n\t\tapplyStartValues(div, startValues);\r\n\t}\r\n\r\n\treturn div;\r\n}\r\n\r\nexport function once(func): typeof func {\r\n\tlet done: boolean,\r\n\t\tresult: any;\r\n\r\n\treturn function(this: any) {\r\n\t\tif (!done) {\r\n\t\t\tresult = func.apply(this, arguments);\r\n\t\t\tfunc = done = true; // Don't care about type, just let the GC collect if possible\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n}\r\n\r\nexport function sleep(ms: number) {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n}\r\n\r\n/**\r\n * Create an asyn callback. Each callback must be independant of all others, and\r\n * gets it's own unique done() callback to use. This also requires a count of\r\n * the number of tests run, and the assert object used.\r\n * Call without any arguments to get a total count of tests requested.\r\n */\r\nexport function asyncTests(): number;\r\nexport function asyncTests(assert: Assert, count: number, callback: (done: () => void) => void): void;\r\nexport function asyncTests(assert?: Assert, count?: number, callback?: (done: () => void) => void): number {\r\n\tif (!assert) {\r\n\t\tconst oldCount = asyncCount;\r\n\r\n\t\tasyncCount = 0;\r\n\r\n\t\treturn oldCount;\r\n\t}\r\n\tconst done = assert.async(1);\r\n\r\n\tasyncCount += count;\r\n\tsetTimeout(() => {\r\n\t\tcallback(done);\r\n\t}, 1);\r\n}\r\n\r\nexport function isEmptyObject(variable): variable is {} {\r\n\tfor (const name in variable) {\r\n\t\tif (variable.hasOwnProperty(name)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nQUnit.testDone(() => {\r\n\ttry {\r\n\t\tdocument.querySelectorAll(\".velocity-animating\")\r\n\t\t\t.velocity(\"stop\");\r\n\t} catch {\r\n\t\t// We don't care if it fails.\r\n\t}\r\n\t// Free all targets requested by the current test.\r\n\twhile (targets.length) {\r\n\t\ttry {\r\n\t\t\t$qunitStage.removeChild(targets.pop());\r\n\t\t} catch {\r\n\t\t\t// We don't care if it fails.\r\n\t\t}\r\n\t}\r\n\t// Ensure we have reset the test counter.\r\n\tasyncTests();\r\n\t// Make sure Velocity goes back to defaults.\r\n\tVelocity.defaults.reset();\r\n});\r\n\r\n/* Cleanup */\r\nQUnit.done((details) => {\r\n\t//\t$(\".velocity-animating\").velocity(\"stop\");\r\n\tconsole.log(\"Total: \", details.total, \" Failed: \", details.failed, \" Passed: \", details.passed, \" Runtime: \", details.runtime);\r\n});\r\n\r\n/* Helpful redirect for testing custom and parallel queues. */\r\n// var $div2 = $(\"#DataBody-PropertiesDummy\");\r\n// $.fn.velocity.defaults.duration = 1000;\r\n// $div2.velocity(\"scroll\", { queue: \"test\" })\r\n// $div2.velocity({width: 100}, { queue: \"test\" })\r\n// $div2.velocity({ borderWidth: 50 }, { queue: \"test\" })\r\n// $div2.velocity({height: 20}, { queue: \"test\" })\r\n// $div2.velocity({marginLeft: 200}, { queue: \"test\" })\r\n// $div2.velocity({paddingTop: 60});\r\n// $div2.velocity({marginTop: 100});\r\n// $div2.velocity({paddingRight: 40});\r\n// $div2.velocity({marginTop: 0})\r\n// $div2.dequeue(\"test\")\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"Core\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityOptions, VelocityResult} from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Arguments\", (assert) => {\r\n\tconst testComplete = () => {\r\n\t\t// Do nothing\r\n\t},\r\n\t\ttestDuration = 1000,\r\n\t\ttestEasing = \"easeInSine\",\r\n\t\ttestOptions: VelocityOptions = {\r\n\t\t\tduration: 123,\r\n\t\t\teasing: testEasing,\r\n\t\t\tcomplete: testComplete,\r\n\t\t};\r\n\tlet result: VelocityResult;\r\n\r\n\tassert.expect(18);\r\n\r\n\t/****************\r\n\t Overloading\r\n\t ****************/\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties);\r\n\tassert.ok(result.length,\r\n\t\t\"Overload variation #1a: Velocity(ELEMENT, {properties})\");\r\n\tassert.ok(result.velocity.animations.length,\r\n\t\t\"Overload variation #1b: Velocity(element, {PROPERTIES})\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #2a: Velocity(element, {properties}, DURATION)\");\r\n\tresult = Velocity(getTarget(), defaultProperties, \"slow\");\r\n\tassert.equal(result.velocity.animations[0].options.duration, 600,\r\n\t\t\"Overload variation #2b: Velocity(element, {properties}, DURATION)\");\r\n\tresult = Velocity(getTarget(), defaultProperties, \"normal\");\r\n\tassert.equal(result.velocity.animations[0].options.duration, 400,\r\n\t\t\"Overload variation #2c: Velocity(element, {properties}, DURATION)\");\r\n\tresult = Velocity(getTarget(), defaultProperties, \"fast\");\r\n\tassert.equal(result.velocity.animations[0].options.duration, 200,\r\n\t\t\"Overload variation #2d: Velocity(element, {properties}, DURATION)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testEasing);\r\n\tassert.equal(typeof result.velocity.animations[0].options.easing, \"function\",\r\n\t\t\"Overload variation #3: Velocity(element, {properties}, EASING)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testComplete);\r\n\tassert.equal(typeof result.velocity.animations[0].options.complete, \"function\",\r\n\t\t\"Overload variation #4: Velocity(element, {properties}, COMPLETE)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration, [0.42, 0, 0.58, 1]);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #5a: Velocity(element, {properties}, DURATION, easing)\");\r\n\tassert.equal(result.velocity.animations[0].options.easing(0.2, 0, 1), 0.0816598562658975,\r\n\t\t\"Overload variation #5b: Velocity(element, {properties}, duration, EASING)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration, testComplete);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #6a: Velocity(element, {properties}, DURATION, complete)\");\r\n\tassert.equal(result.velocity.animations[0].options.complete, testComplete,\r\n\t\t\"Overload variation #6b: Velocity(element, {properties}, duration, COMPLETE)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration, testEasing, testComplete);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #7a: Velocity(element, {properties}, DURATION, easing, complete)\");\r\n\tassert.equal(typeof result.velocity.animations[0].options.easing, \"function\",\r\n\t\t\"Overload variation #7b: Velocity(element, {properties}, duration, EASING, complete)\");\r\n\tassert.equal(result.velocity.animations[0].options.complete, testComplete,\r\n\t\t\"Overload variation #7c: Velocity(element, {properties}, duration, easing, COMPLETE)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testOptions);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testOptions.duration,\r\n\t\t\"Overload variation #8: Velocity(element, {properties}, {OPTIONS})\");\r\n\r\n\tVelocity({elements: [getTarget()], properties: defaultProperties, options: testOptions});\r\n\tassert.equal(result.velocity.animations[0].options.duration, testOptions.duration,\r\n\t\t\"Overload variation #9: Velocity({elements:[elements], properties:{properties}, options:{OPTIONS})\");\r\n\r\n\tVelocity({elements: [getTarget()], properties: \"stop\", options: testOptions});\r\n\tassert.equal(result.velocity.animations[0].options.duration, testOptions.duration,\r\n\t\t\"Overload variation #10: Velocity({elements:[elements], properties:\\\"ACTION\\\", options:{OPTIONS})\");\r\n\r\n\t//\tvar $target12 = getTarget();\r\n\t//\tVelocity($target12, {opacity: [0.75, \"spring\", 0.25]}, testDuration);\r\n\t//\tassert.equal(Data($target12).style.opacity.startValue, 0.25, \"Overload variation #10a.\");\r\n\t//\tassert.equal(Data($target12).style.opacity.easing, \"spring\", \"Overload variation #10b.\");\r\n\t//\tassert.equal(Data($target12).style.opacity.endValue, 0.75, \"Overload variation #10c.\");\r\n\r\n\t//\tvar $target13 = getTarget();\r\n\t//\tVelocity($target13, {opacity: [0.75, 0.25]}, testDuration);\r\n\t//\tassert.equal(Data($target13).style.opacity.startValue, 0.25, \"Overload variation #11a.\");\r\n\t//\tassert.equal(Data($target13).style.opacity.endValue, 0.75, \"Overload variation #11b.\");\r\n\r\n\t//\tvar $target14 = getTarget();\r\n\t//\tVelocity($target14, {opacity: [0.75, \"spring\"]}, testDuration);\r\n\t//\tassert.equal(Data($target14).style.opacity.endValue, 0.75, \"Overload variation #12a.\");\r\n\t//\tassert.equal(Data($target14).style.opacity.easing, \"spring\", \"Overload variation #12b.\");\r\n\r\n\t//\tif ($) {\r\n\t//\t\tvar $target17 = getTarget();\r\n\t//\t\t$($target17).velocity(defaultProperties, testOptions);\r\n\t//\t\tassert.deepEqual(Data($target17).opts, testOptions, \"$.fn.: Utility function variation #1: options object.\");\r\n\t//\r\n\t//\t\tvar $target18 = getTarget();\r\n\t//\t\t$($target18).velocity({properties: defaultProperties, options: testOptions});\r\n\t//\t\tassert.deepEqual(Data($target18).opts, testOptions, \"$.fn.: Utility function variation #2: single object.\");\r\n\t//\r\n\t//\t\tvar $target19 = getTarget();\r\n\t//\t\t$($target19).velocity(defaultProperties, testDuration, testEasing, testComplete);\r\n\t//\t\tassert.equal(Data($target19).opts.duration, testDuration, \"$.fn.: Utility function variation #2a.\");\r\n\t//\t\tassert.equal(Data($target19).opts.easing, testEasing, \"$.fn.: Utility function variation #2b.\");\r\n\t//\t\tassert.equal(Data($target19).opts.complete, testComplete, \"$.fn.: Utility function variation #2c.\");\r\n\t//\r\n\t//\t\tvar $target20 = getTarget();\r\n\t//\t\tassert.equal($($target20).length, $($target20).velocity(defaultProperties, testDuration, testEasing, testComplete)\r\n\t//\t\t.velocity(defaultProperties, testDuration, testEasing, testComplete).length, \"$.fn.: Elements passed back to the call stack.\");\r\n\t//\t\t// TODO: Should check in a better way - but the prototype chain is now extended with a Promise so a standard (non-length) comparison *will* fail\r\n\t//\t}\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"End Value Caching\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\tnewProperties = {height: \"50px\", width: \"250px\"};\r\n\r\n\tassert.expect(4);\r\n\r\n\t/* Called after the last call is complete (stale). Ensure that the newly-set (via $.css()) properties are used. */\r\n\tVelocity(getTarget(newProperties), defaultProperties)\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(Data(elements[0]).cache.width, defaultProperties.width, \"Stale end value #1 wasn't pulled.\");\r\n\t\t\tassert.equal(Data(elements[0]).cache.height, defaultProperties.height, \"Stale end value #2 wasn't pulled.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), defaultProperties)\r\n\t\t.velocity(newProperties)\r\n\t\t.then((elements) => {\r\n\t\t\t/* Chained onto a previous call (fresh). */\r\n\t\t\tassert.equal(Data(elements[0]).cache.width, newProperties.width, \"Chained end value #1 was pulled.\");\r\n\t\t\tassert.equal(Data(elements[0]).cache.height, newProperties.height, \"Chained end value #2 was pulled.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"End Value Setting\", (assert) => {\r\n\tconst done = assert.async(1);\r\n\r\n\t/* Standard properties. */\r\n\tVelocity(getTarget(), defaultProperties)\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(Velocity(elements[0], \"style\", \"width\"), defaultProperties.width, \"Standard end value #1 was set.\");\r\n\t\t\tassert.equal(Velocity(elements[0], \"style\", \"opacity\"), defaultProperties.opacity, \"Standard end value #2 was set.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {$qunitStage, applyStartValues, Data, defaultProperties, defaultStyles, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Start Value Calculation\", (assert) => {\r\n\tconst testStartValues = {\r\n\t\tpaddingLeft: \"10px\",\r\n\t\theight: \"100px\",\r\n\t\tpaddingRight: \"50%\",\r\n\t\tmarginLeft: \"100px\",\r\n\t\tmarginBottom: \"33%\",\r\n\t\tmarginTop: \"100px\",\r\n\t\tlineHeight: \"30px\",\r\n\t\twordSpacing: \"40px\",\r\n\t\tbackgroundColor: \"rgb(123,0,0)\",\r\n\t};\r\n\r\n\t/* Properties not previously defined on the element. */\r\n\tconst $target1 = getTarget();\r\n\r\n\tVelocity($target1, testStartValues);\r\n\tassert.equal(Data($target1).cache.paddingLeft, testStartValues.paddingLeft, \"Undefined standard start value was calculated.\");\r\n\tassert.equal(Data($target1).cache.backgroundColor, testStartValues.backgroundColor, \"Undefined start value hook was calculated.\");\r\n\r\n\t/* Properties previously defined on the element. */\r\n\tconst $target2 = getTarget();\r\n\r\n\tVelocity($target2, defaultProperties);\r\n\tassert.equal(Data($target2).cache.width, parseFloat(defaultStyles.width as any), \"Defined start value #1 was calculated.\");\r\n\tassert.equal(Data($target2).cache.opacity, parseFloat(defaultStyles.opacity as any), \"Defined start value #2 was calculated.\");\r\n\tassert.equal(Data($target2).cache.color, parseFloat(defaultStyles.colorGreen as any), \"Defined hooked start value was calculated.\");\r\n\r\n\t/* Properties that shouldn't cause start values to be unit-converted. */\r\n\tconst testPropertiesEndNoConvert = {paddingLeft: \"20px\", height: \"40px\", paddingRight: \"75%\"},\r\n\t\t$target3 = getTarget();\r\n\r\n\tapplyStartValues($target3, testStartValues);\r\n\tVelocity($target3, testPropertiesEndNoConvert);\r\n\tassert.equal(Data($target3).cache.paddingLeft, parseFloat(testStartValues.paddingLeft), \"Start value #1 wasn't unit converted.\");\r\n\tassert.equal(Data($target3).cache.height, parseFloat(testStartValues.height), \"Start value #2 wasn't unit converted.\");\r\n\t//\t\t\tassert.deepEqual(Data($target3).cache.paddingRight.startValue, [Math.floor((parentWidth * parseFloat(testStartValues.paddingRight)) / 100), 0],\r\n\t//\t\t\t \"Start value #3 was pattern matched.\");\r\n\r\n\t/* Properties that should cause start values to be unit-converted. */\r\n\tconst testPropertiesEndConvert = {paddingLeft: \"20%\", height: \"40%\", lineHeight: \"0.5em\", wordSpacing: \"2rem\", marginLeft: \"10vw\", marginTop: \"5vh\", marginBottom: \"100px\"},\r\n\t\tparentWidth = $qunitStage.clientWidth,\r\n\t\tparentHeight = $qunitStage.clientHeight,\r\n\t\tparentFontSize = Velocity($qunitStage, \"style\", \"fontSize\"),\r\n\t\tremSize = parseFloat(Velocity(document.body, \"style\", \"fontSize\") as any),\r\n\t\t$target4 = getTarget();\r\n\r\n\tapplyStartValues($target4, testStartValues);\r\n\tVelocity($target4, testPropertiesEndConvert);\r\n\r\n\t/* Long decimal results can be returned after unit conversion, and Velocity's code and the code here can differ in precision. So, we round floor values before comparison. */\r\n\t//\t\t\tassert.deepEqual(Data($target4).cache.paddingLeft.startValue, [parseFloat(testStartValues.paddingLeft), 0],\r\n\t//\t\t\t \"Horizontal property converted to %.\");\r\n\tassert.equal(parseInt(Data($target4).cache.height, 10), Math.floor((parseFloat(testStartValues.height) / parentHeight) * 100), \"Vertical property converted to %.\");\r\n\t//\t\t\tassert.equal(Data($target4).cache.lineHeight.startValue, Math.floor(parseFloat(testStartValues.lineHeight) / parseFloat(parentFontSize)),\r\n\t//\t\t\t \"Property converted to em.\");\r\n\t//\t\t\tassert.equal(Data($target4).cache.wordSpacing.startValue, Math.floor(parseFloat(testStartValues.wordSpacing) / parseFloat(remSize)),\r\n\t//\t\t\t \"Property converted to rem.\");\r\n\tassert.equal(parseInt(Data($target4).cache.marginBottom, 10), parseFloat(testStartValues.marginBottom) / 100 * parseFloat($target4.parentElement.offsetWidth as any),\r\n\t\t\"Property converted to px.\");\r\n\r\n\t//\t\t\tif (!(IE<=8) && !isAndroid) {\r\n\t//\t\t\t\tassert.equal(Data($target4).cache.marginLeft.startValue, Math.floor(parseFloat(testStartValues.marginLeft) / window.innerWidth * 100),\r\n\t//\t\t\t\t \"Horizontal property converted to vw.\");\r\n\t//\t\t\t\tassert.equal(Data($target4).cache.marginTop.startValue, Math.floor(parseFloat(testStartValues.marginTop) / window.innerHeight * 100),\r\n\t//\t\t\t\t \"Vertical property converted to vh.\");\r\n\t//\t\t\t}\r\n\r\n\t// TODO: Tests for auto-parameters as the units are no longer converted.\r\n\r\n\t/* jQuery TRBL deferring. */\r\n\tconst testPropertiesTRBL = {left: \"1000px\"},\r\n\t\t$TRBLContainer = document.createElement(\"div\");\r\n\r\n\t$TRBLContainer.setAttribute(\"id\", \"TRBLContainer\");\r\n\t$TRBLContainer.style.marginLeft = testPropertiesTRBL.left;\r\n\t$TRBLContainer.style.width = \"100px\";\r\n\t$TRBLContainer.style.height = \"100px\";\r\n\tdocument.body.appendChild($TRBLContainer);\r\n\r\n\tconst $target5 = getTarget();\r\n\r\n\t$target5.style.position = \"absolute\";\r\n\t$TRBLContainer.appendChild($target5);\r\n\tVelocity($target5, testPropertiesTRBL);\r\n\r\n\tassert.equal(parseInt(Data($target5).cache.left, 10),\r\n\t\tMath.round(parseFloat(testPropertiesTRBL.left) + parseFloat(Velocity(document.body, \"style\", \"marginLeft\") as any)),\r\n\t\t\"TRBL value was deferred to jQuery.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Unit Calculation\", (assert) => {\r\n\t// TODO: Add code and tests for operators - probably using calc() internally\r\n\t//\t/* Standard properties with operators. */\r\n\t//\tvar testIncrementWidth = \"5px\",\r\n\t//\t\t\ttestDecrementOpacity = 0.25,\r\n\t//\t\t\ttestMultiplyMarginBottom = 4,\r\n\t//\t\t\ttestDivideHeight = 2;\r\n\t//\r\n\t//\tvar $target2 = getTarget();\r\n\t//\tVelocity($target2, {width: \"+=\" + testIncrementWidth, opacity: \"-=\" + testDecrementOpacity, marginBottom: \"*=\" + testMultiplyMarginBottom, height: \"/=\" + testDivideHeight});\r\n\t//\tsetTimeout(function() {\r\n\t//\r\n\t//\t\tassert.equal(Data($target2).style.width.endValue, defaultStyles.width + parseFloat(testIncrementWidth), \"Incremented end value was calculated.\");\r\n\t//\t\tassert.equal(Data($target2).style.opacity.endValue, defaultStyles.opacity - testDecrementOpacity, \"Decremented end value was calculated.\");\r\n\t//\t\tassert.equal(Data($target2).style.marginBottom.endValue, defaultStyles.marginBottom * testMultiplyMarginBottom, \"Multiplied end value was calculated.\");\r\n\t//\t\tassert.equal(Data($target2).style.height.endValue, defaultStyles.height / testDivideHeight, \"Divided end value was calculated.\");\r\n\t//\r\n\t//\t\tdone();\r\n\t//\t}, asyncCheckDuration);\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {left: \"500px\"}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"500px\", \"Finished animated value with given pixels should be the same.\");\r\n\t\tVelocity($target, {left: \"0px\"}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Finished animated value with 0px should be the same.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\t//\tasync(assert, 1, async (done) => {\r\n\t//\t\tconst $target = getTarget();\r\n\t//\r\n\t//\t\tVelocity($target, {left: \"500px\"}, {duration: 10});\r\n\t//\t\tawait sleep(100);\r\n\t//\t\tVelocity($target, {left: \"0\"}, {duration: 10});\r\n\t//\t\tawait sleep(100);\r\n\t//\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Finished animated value without giving px, but only number as a string should be the same.\");\r\n\t//\r\n\t//\t\tdone();\r\n\t//\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {left: \"500px\"}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tVelocity($target, {left: 0}, {duration: 10});\r\n\t\tawait sleep(1000);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Finished animated value given as number 0 should be the same as 0px.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {left: 500}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"500px\", \"Finished animated value with given pixels should be the same.\");\r\n\t\tVelocity($target, {left: 0}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Omitted pixels (px) when given animation should run properly.\");\r\n\r\n\t\tdone();\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"Option\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Begin\", (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $targetSet = [getTarget(), getTarget()];\r\n\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.deepEqual(elements, $targetSet, \"Elements passed into callback.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Complete\", (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $targetSet = [getTarget(), getTarget()];\r\n\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.deepEqual(elements, $targetSet, \"Elements passed into callback.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultOptions, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Delay\", (assert) => {\r\n\tconst testDelay = 250;\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst start = getNow();\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration: defaultOptions.duration,\r\n\t\t\tdelay: testDelay,\r\n\t\t\tbegin(elements, activeCall) {\r\n\t\t\t\tassert.close(getNow() - start, testDelay, 32, \"Delayed calls start after the correct delay.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst start = getNow();\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration: defaultOptions.duration,\r\n\t\t\tdelay: testDelay,\r\n\t\t})\r\n\t\t\t.velocity(defaultProperties, {\r\n\t\t\t\tduration: defaultOptions.duration,\r\n\t\t\t\tdelay: testDelay,\r\n\t\t\t\tbegin(elements, activeCall) {\r\n\t\t\t\t\tassert.close(getNow() - start, (testDelay * 2) + (defaultOptions.duration as number), 32, \"Queued delays start after the correct delay.\");\r\n\r\n\t\t\t\t\tdone();\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Easing\", (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tlet success = false;\r\n\r\n\t\ttry {\r\n\t\t\tsuccess = true;\r\n\t\t\tVelocity(getTarget(), defaultProperties, {easing: \"fake\"});\r\n\t\t} catch (e) {\r\n\t\t\tsuccess = false;\r\n\t\t}\r\n\t\tassert.ok(success, \"Fake easing string didn't throw error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tlet success = false;\r\n\r\n\t\ttry {\r\n\t\t\tsuccess = true;\r\n\t\t\tVelocity(getTarget(), defaultProperties, {easing: [\"a\" as any, 0.5, 0.5, 0.5]});\r\n\t\t\tVelocity(getTarget(), defaultProperties, {easing: [0.5, 0.5, 0.5]});\r\n\t\t} catch (e) {\r\n\t\t\tsuccess = false;\r\n\t\t}\r\n\t\tassert.ok(success, \"Invalid bezier curve didn't throw error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\t// TODO: Use a \"tween\" action?\r\n\t\t/* Ensure that a properly-formatted bezier curve array returns a bezier function. */\r\n\t\tconst easingBezierArray = [0.27, -0.65, 0.78, 0.19],\r\n\t\t\teasingBezierTestPercent = 0.25,\r\n\t\t\teasingBezierTestValue = -0.23;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\teasing: easingBezierArray,\r\n\t\t\tbegin(elements, animation) {\r\n\t\t\t\tassert.close(animation.options.easing(easingBezierTestPercent, 0, 1), easingBezierTestValue, 0.005, \"Array converted into bezier function.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\t/* Ensure that a properly-formatted spring RK4 array returns a bezier function. */\r\n\t\tconst easingSpringRK4Array = [250, 12],\r\n\t\t\teasingSpringRK4TestPercent = 0.25,\r\n\t\t\teasingSpringRK4TestValue = 0.928, // TODO: Check accuracy\r\n\t\t\teasingSpringRK4TestDuration = 992;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration: 150,\r\n\t\t\teasing: easingSpringRK4Array,\r\n\t\t\tbegin(elements, animation) {\r\n\t\t\t\tassert.close(animation.options.easing(easingSpringRK4TestPercent, 0, 1), easingSpringRK4TestValue, 10, \"Array with duration converted into springRK4 function.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\t// TODO: Get this working in Velocity - so it can be tested\r\n\t//\tasync(assert, 1, (done) => {\r\n\t//\tVelocity(getTarget(), defaultProperties, {\r\n\t//\t\teasing: easingSpringRK4Array,\r\n\t//\t\tbegin(elements, animation) {\r\n\t//\t\t\tassert.equal(animation.duration, easingSpringRK4TestDuration, \"Array without duration converted into springRK4 duration.\");\r\n\t//\t\t\tdone();\r\n\t//\t\t}\r\n\t//\t});\r\n\t//\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\t/* Ensure that a properly-formatted step easing array returns a step function. */\r\n\t\tconst easingStepArray = [4],\r\n\t\t\teasingStepTestPercent = 0.35,\r\n\t\t\teasingStepTestValue = 0.25;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\teasing: easingStepArray,\r\n\t\t\tbegin(elements, animation) {\r\n\t\t\t\tassert.close(animation.options.easing(easingStepTestPercent, 0, 1), easingStepTestValue, 0.05, \"Array converted into Step function.\");\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 3, (done) => {\r\n\t\tVelocity(getTarget(), {opacity: [0, \"during\", 1]}, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct begin value (easing:'during').\");\r\n\t\t\t},\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct progress value (easing:'during').\");\r\n\t\t\t}),\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct complete value (easing:'during').\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 3, (done) => {\r\n\t\tVelocity(getTarget(), {opacity: [0, \"at-start\", 1]}, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct begin value (easing:'at-start').\");\r\n\t\t\t},\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct progress value (easing:'at-start').\");\r\n\t\t\t}),\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct complete value (easing:'at-start').\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 3, (done) => {\r\n\t\tVelocity(getTarget(), {opacity: [0, \"at-end\", 1]}, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct begin value (easing:'at-end').\");\r\n\t\t\t},\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct progress value (easing:'at-end').\");\r\n\t\t\t}),\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct complete value (easing:'at-end').\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"FPS Limit\", async (assert) => {\r\n\tlet count: number;\r\n\tconst $target = getTarget(),\r\n\t\tframeRates = [5, 15, 30, 60],\r\n\t\ttestFrame = (frameRate) => {\r\n\t\t\tlet counter = 0;\r\n\r\n\t\t\tVelocity.defaults.fpsLimit = frameRate;\r\n\t\t\t// Test if the frame rate is assigned succesfully.\r\n\t\t\tassert.equal(frameRate, Velocity.defaults.fpsLimit, \"Setting global fps limit to \" + frameRate);\r\n\r\n\t\t\treturn Velocity($target, defaultProperties,\r\n\t\t\t\t{\r\n\t\t\t\t\tduration: 1000,\r\n\t\t\t\t\tprogress() {\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t},\r\n\t\t\t\t})\r\n\t\t\t\t.then(() => counter);\r\n\t\t};\r\n\r\n\tassert.expect(frameRates.length * 2);\r\n\t// Test if the limit is working for 60, 30, 15 and 5 fps.\r\n\tfor (const frameRate of frameRates) {\r\n\t\tassert.ok((count = await testFrame(frameRate)) <= frameRate + 1, `...counted ${count} frames (\\xB11 frame)`);\r\n\t}\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Loop\", (assert) => {\r\n\tasyncTests(assert, 4, (done) => {\r\n\t\tconst testOptions = {loop: 2, delay: 100, duration: 100},\r\n\t\t\tstart = getNow();\r\n\t\tlet begin = 0,\r\n\t\t\tcomplete = 0,\r\n\t\t\tloop = 0,\r\n\t\t\tlastPercentComplete = 2;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties,\r\n\t\t\t{\r\n\t\t\t\tloop: testOptions.loop,\r\n\t\t\t\tdelay: testOptions.delay,\r\n\t\t\t\tduration: testOptions.duration,\r\n\t\t\t\tbegin() {\r\n\t\t\t\t\tbegin++;\r\n\t\t\t\t},\r\n\t\t\t\tprogress(elements, percentComplete) {\r\n\t\t\t\t\tif (lastPercentComplete > percentComplete) {\r\n\t\t\t\t\t\tloop++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastPercentComplete = percentComplete;\r\n\t\t\t\t},\r\n\t\t\t\tcomplete() {\r\n\t\t\t\t\tcomplete++;\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tassert.equal(begin, 1, \"Begin callback only called once.\");\r\n\t\t\t\tassert.equal(loop, testOptions.loop * 2 - 1, \"Animation looped correct number of times (once each direction per loop).\");\r\n\t\t\t\tassert.close(getNow() - start, (testOptions.delay + testOptions.duration) * loop, 32, \"Looping with 'delay' has correct duration.\");\r\n\t\t\t\tassert.equal(complete, 1, \"Complete callback only called once.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Progress\", (assert) => {\r\n\tasyncTests(assert, 4, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tprogress: once(function(elements, percentComplete, msRemaining) { // tslint:disable-line:only-arrow-functions\r\n\t\t\t\tassert.deepEqual(elements, [$target], \"Elements passed into progress.\");\r\n\t\t\t\tassert.deepEqual(this, [$target], \"Elements passed into progress as this.\"); // tslint:disable-line:no-invalid-this\r\n\t\t\t\tassert.equal(percentComplete >= 0 && percentComplete <= 1, true, \"'percentComplete' passed into progress.\");\r\n\t\t\t\tassert.equal(msRemaining > asyncCheckDuration - 50, true, \"'msRemaining' passed into progress.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t}),\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Queue\", (assert) => {\r\n\tconst done = assert.async(4),\r\n\t\ttestQueue = \"custom\",\r\n\t\t$target = getTarget(),\r\n\t\tignore = $target.velocity(\"style\", \"display\"), // Force data creation\r\n\t\tdata = Data($target);\r\n\tlet anim1: boolean,\r\n\t\tanim2: boolean,\r\n\t\tanim3: boolean;\r\n\r\n\tassert.expect(7);\r\n\r\n\tassert.ok(data.queueList[testQueue] === undefined, \"Custom queue is empty.\"); // Shouldn't exist\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tqueue: testQueue,\r\n\t\tbegin() {\r\n\t\t\tanim1 = true;\r\n\t\t},\r\n\t\tcomplete() {\r\n\t\t\tanim1 = false;\r\n\t\t\tassert.ok(!anim2, \"Queued animation isn't started early.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t});\r\n\tassert.ok(data.queueList[testQueue] !== undefined, \"Custom queue was created.\"); // Should exist, but be \"null\"\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tqueue: testQueue,\r\n\t\tbegin() {\r\n\t\t\tanim2 = true;\r\n\t\t\tassert.ok(anim1 === false, \"Queued animation starts after first.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete() {\r\n\t\t\tanim2 = false;\r\n\t\t},\r\n\t});\r\n\tassert.ok(data.queueList[testQueue], \"Custom queue grows.\"); // Should exist and point at the next animation\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tbegin() {\r\n\t\t\tanim3 = true;\r\n\t\t\tassert.ok(anim1 === true, \"Different queue animation starts in parallel.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete() {\r\n\t\t\tanim3 = false;\r\n\t\t},\r\n\t});\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tqueue: false,\r\n\t\tbegin() {\r\n\t\t\tassert.ok(anim1 === true, \"Queue:false animation starts in parallel.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Repeat\", (assert) => {\r\n\tasyncTests(assert, 4, (done) => {\r\n\t\tconst testOptions = {repeat: 2, delay: 100, duration: 100},\r\n\t\t\tstart = Date.now();\r\n\t\tlet begin = 0,\r\n\t\t\tcomplete = 0,\r\n\t\t\trepeat = 0;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\trepeat: testOptions.repeat,\r\n\t\t\tdelay: testOptions.delay,\r\n\t\t\tduration: testOptions.duration,\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin++;\r\n\t\t\t},\r\n\t\t\tprogress(elements, percentComplete) {\r\n\t\t\t\tif (percentComplete === 1) {\r\n\t\t\t\t\trepeat++;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete++;\r\n\t\t\t\tassert.equal(begin, 1, \"Begin callback only called once.\");\r\n\t\t\t\tassert.equal(repeat, testOptions.repeat + 1, \"Animation repeated correct number of times (original plus repeats).\");\r\n\t\t\t\tassert.close(Date.now() - start, (testOptions.delay + testOptions.duration) * (testOptions.repeat + 1), (testOptions.repeat + 1) * 16 + 32,\r\n\t\t\t\t\t\"Repeat with 'delay' has correct duration.\");\r\n\t\t\t\tassert.equal(complete, 1, \"Complete callback only called once.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityExtended} from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\ninterface ExtendedVelocityExtended extends VelocityExtended {\r\n\t__count?: number;\r\n\t__start?: number;\r\n}\r\n\r\nQUnit.test(\"Speed\", (assert) => {\r\n\tconst delay = 200,\r\n\t\tduration = 400,\r\n\t\tstartDelay = getNow();\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity.defaults.speed = 3;\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tspeed: 5,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity.animations[0].options.speed, 5, \"Speed on options overrides default.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = getNow();\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = duration / 3;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Velocity.defaults.speed change is respected. (\\xD73, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tspeed: 2,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = getNow();\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = duration / 2;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Double speed animation lasts half as long. (\\xD72, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tdelay,\r\n\t\t\tspeed: 2,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = startDelay;\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = (duration + delay) / 2;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Delayed animation includes speed for delay. (\\xD72, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tdelay: -delay,\r\n\t\t\tspeed: 2,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = startDelay;\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = (duration - delay) / 2;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Negative delay animation includes speed for delay. (\\xD72, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tspeed: 0.5,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = getNow();\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = duration * 2;\r\n\r\n\t\t\t\t// TODO: Really not happy with the allowed range - it sits around 40ms, but should be closer to 16ms\r\n\t\t\t\tassert.close(actual, expected, 64, `Half speed animation lasts twice as long. (\\xD7\\xBD, ${Math.floor(actual - expected)}ms \\xB164ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tspeed: 0,\r\n\t\t\tprogress(elements: ExtendedVelocityExtended, percentComplete) {\r\n\t\t\t\tif (!elements.__count) {\r\n\t\t\t\t\telements.__start = percentComplete;\r\n\t\t\t\t\telements.__count = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassert.equal(elements.__start, percentComplete, \"Frozen (speed:0) animation doesn't progress.\");\r\n\t\t\t\t\telements\r\n\t\t\t\t\t\t.velocity(\"option\", \"speed\", 1) // Just in case \"stop\" is broken\r\n\t\t\t\t\t\t.velocity(\"stop\");\r\n\r\n\t\t\t\t\tdone();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Sync\", (assert) => {\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\t$targetSet = [getTarget(), $target, getTarget()];\r\n\t\tlet complete = false;\r\n\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tduration: 300,\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tsync: false,\r\n\t\t\tduration: 250,\r\n\t\t});\r\n\t\tawait sleep(275);\r\n\t\tassert.notOk(complete, \"Sync 'false' animations don't wait for completion.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\t$targetSet = [getTarget(), $target, getTarget()];\r\n\t\tlet complete = false;\r\n\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tduration: 300,\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tsync: true,\r\n\t\t\tduration: 250,\r\n\t\t\tbegin() {\r\n\t\t\t\tassert.ok(complete, \"Sync 'true' animations wait for completion.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"Command\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultOptions, defaultProperties, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Finish\", async (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), \"finish\");\r\n\t\tassert.ok(true, \"Calling on an element that isn't animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, defaultProperties, defaultOptions);\r\n\t\tVelocity($target, {top: 0}, defaultOptions);\r\n\t\tVelocity($target, {width: 0}, defaultOptions);\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.ok(true, \"Calling on an element that is animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet complete1 = false,\r\n\t\t\tcomplete2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test1\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete1 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test2\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"finish\", \"test1\");\r\n\t\tawait sleep(defaultOptions.duration as number / 2);\r\n\t\tassert.ok(complete1, \"Finish animation with correct queue.\");\r\n\t\tassert.notOk(complete2, \"Don't finish animation with wrong queue.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin = false,\r\n\t\t\tcomplete = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin = true;\r\n\t\t\t},\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tawait sleep(500);\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.ok(begin, \"Finish calls 'begin()' callback without delay.\");\r\n\t\tassert.ok(complete, \"Finish calls 'complete()' callback without delay.\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Finish animation with correct value.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin = false,\r\n\t\t\tcomplete = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tdelay: 1000,\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin = true;\r\n\t\t\t},\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tawait sleep(500);\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.ok(begin, \"Finish calls 'begin()' callback with delay.\");\r\n\t\tassert.ok(complete, \"Finish calls 'complete()' callback with delay.\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Finish animation with correct value before delay ends.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0})\r\n\t\t\t.velocity({opacity: 1})\r\n\t\t\t.velocity({opacity: 0.25})\r\n\t\t\t.velocity({opacity: 0.75})\r\n\t\t\t.velocity({opacity: 0.5});\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Finish once starts the second animation.\");\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Finish twice starts the third animation.\");\r\n\t\tVelocity($target, \"finish\", true);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0.5\", \"Finish 'true' finishes all animations.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Pause + Resume\", async (assert) => {\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, \"pause\");\r\n\t\tassert.ok(true, \"Calling \\\"pause\\\" on an element that isn't animating doesn't cause an error.\");\r\n\t\tVelocity($target, \"resume\");\r\n\t\tassert.ok(true, \"Calling \\\"resume\\\" on an element that isn't animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 4, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet progress = false;\r\n\r\n\t\tVelocity($target, {opacity: 0}, {\r\n\t\t\tduration: 250,\r\n\t\t\tprogress() {\r\n\t\t\t\tprogress = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"pause\");\r\n\t\tawait sleep(50);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Property value unchanged after pause.\");\r\n\t\tassert.notOk(progress, \"Progress callback not run during pause.\");\r\n\t\tVelocity($target, \"resume\");\r\n\t\tawait sleep(300);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Tween completed after pause/resume.\");\r\n\t\tassert.ok(progress, \"Progress callback run after pause.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0}, {duration: 250, delay: 250});\r\n\t\tVelocity($target, \"pause\");\r\n\t\tawait sleep(500);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Delayed property value unchanged after pause.\");\r\n\t\tVelocity($target, \"resume\");\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Delayed tween did not start early after pause.\");\r\n\t\tawait sleep(500);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Delayed tween completed after pause/resume.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0}, {queue: \"test\", duration: 250});\r\n\t\tVelocity(\"pause\", \"test\");\r\n\t\tawait sleep(300);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Pause 'queue' works globally.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0})\r\n\t\t\t.velocity(\"pause\");\r\n\t\tawait sleep(300);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Chained pause only pauses chained tweens.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\t// TODO: Better global tests, queue: false, named queues\r\n\r\n\t//\t/* Ensure proper behavior with queue:false */\r\n\t//\tvar $target4 = getTarget();\r\n\t//\tVelocity($target4, {opacity: 0}, {duration: 200});\r\n\t//\r\n\t//\tvar isResumed = false;\r\n\t//\r\n\t//\tawait sleep(100);\r\n\t//\tVelocity($target4, \"pause\");\r\n\t//\tVelocity($target4, {left: -20}, {\r\n\t//\t\tduration: 100,\r\n\t//\t\teasing: \"linear\",\r\n\t//\t\tqueue: false,\r\n\t//\t\tbegin: function(elements) {\r\n\t//\t\t\tassert.ok(true, \"Animation with {queue:false} will run regardless of previously paused animations.\");\r\n\t//\t\t}\r\n\t//\t});\r\n\t//\r\n\t//\tVelocity($target4, {top: 20}, {\r\n\t//\t\tduration: 100,\r\n\t//\t\teasing: \"linear\",\r\n\t//\t\tbegin: function(elements) {\r\n\t//\t\t\tassert.ok(isResumed, \"Queued animation began after previously paused animation completed\");\r\n\t//\t\t}\r\n\t//\t});\r\n\t//\r\n\t//\tawait sleep(100);\r\n\t//\r\n\t//\tisResumed = true;\r\n\t//\tVelocity($target4, \"resume\");\r\n\t//\tawait sleep(100);\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Reverse\", (assert) => {\r\n\tconst $target = getTarget(),\r\n\t\topacity = $target.velocity(\"style\", \"opacity\"),\r\n\t\t// Browsers don't always suffix, but Velocity does.\r\n\t\twidth = $target.velocity(\"style\", \"width\") === \"0\" ? \"0px\" : $target.velocity(\"style\", \"width\");\r\n\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"opacity\"), defaultProperties.opacity, `Initial property #1 set correctly. (${defaultProperties.opacity})`);\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"width\"), defaultProperties.width, `Initial property #2 set correctly. (${defaultProperties.width})`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tVelocity($target, \"reverse\", {\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"opacity\"), opacity, `Reversed property #1 set correctly. (${opacity})`);\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"width\"), width, `Reversed property #2 set correctly. (${width})`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tVelocity($target, \"reverse\", {\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"opacity\"), defaultProperties.opacity, `Chained reversed property #1 set correctly. (${defaultProperties.opacity})`);\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"width\"), defaultProperties.width, `Chained reversed property #2 set correctly. (${defaultProperties.width})`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\n/* Window scrolling. */\r\nQUnit.skip(\"Scroll (Window)\", (assert) => {\r\n\t//\tvar done = assert.async(4),\r\n\t//\t\t$details = $(\"#details\"),\r\n\t//\t\t$scrollTarget1 = $(\"
Scroll target #1. Should stop 50 pixels above this point.
\"),\r\n\t//\t\t$scrollTarget2 = $(\"
Scroll target #2. Should stop 50 pixels before this point.
\"),\r\n\t//\t\tscrollOffset = -50;\r\n\t//\r\n\t//\t$scrollTarget1\r\n\t//\t\t.css({position: \"relative\", top: 3000, height: 100, paddingBottom: 10000})\r\n\t//\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t$scrollTarget2\r\n\t//\t\t.css({position: \"absolute\", top: 100, left: 3000, width: 100, paddingRight: 15000})\r\n\t//\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t$scrollTarget1\r\n\t//\t\t.velocity(\"scroll\", {\r\n\t//\t\t\tduration: 500, offset: scrollOffset, complete: function() {\r\n\t//\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyTop]\r\n\t//\t\t\t\t - ($scrollTarget1.offset().top + scrollOffset)) <= 100, true, \"Page scrolled top with a scroll offset.\");\r\n\t//\r\n\t//\t\t\t\tdone();\r\n\t//\t\t\t}\r\n\t//\t\t})\r\n\t//\t\t.velocity({opacity: 0.5}, function() {\r\n\t//\t\t\t$details\r\n\t//\t\t\t\t.velocity({opacity: 0.5}, 500)\r\n\t//\t\t\t\t.velocity(\"scroll\", 500)\r\n\t//\t\t\t\t.velocity({opacity: 1}, 500, function() {\r\n\t//\t\t\t\t\t//alert(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyTop] + \" \" + ($details.offset().top + scrollOffset))\r\n\t//\t\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyTop]\r\n\t//\t\t\t\t\t - ($details.offset().top + scrollOffset)) <= 100, true, \"Page scroll top was chained.\");\r\n\t//\r\n\t//\t\t\t\t\tdone();\r\n\t//\r\n\t//\t\t\t\t\t//$scrollTarget1.remove();\r\n\t//\r\n\t//\t\t\t\t\t$scrollTarget2\r\n\t//\t\t\t\t\t\t.velocity(\"scroll\", {\r\n\t//\t\t\t\t\t\t\tduration: 500, axis: \"x\", offset: scrollOffset, complete: function() {\r\n\t//\t\t\t\t\t\t\t\t/* Phones can reposition the browser's scroll position by a 10 pixels or so, so we just check for a value that's within that range. */\r\n\t//\t\t\t\t\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyLeft]\r\n\t//\t\t\t\t\t\t\t\t - ($scrollTarget2.offset().left + scrollOffset)) <= 100, true, \"Page scrolled left with a scroll offset.\");\r\n\t//\r\n\t//\t\t\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t\t\t}\r\n\t//\t\t\t\t\t\t})\r\n\t//\t\t\t\t\t\t.velocity({opacity: 0.5}, function() {\r\n\t//\t\t\t\t\t\t\t$details\r\n\t//\t\t\t\t\t\t\t\t.velocity({opacity: 0.5}, 500)\r\n\t//\t\t\t\t\t\t\t\t.velocity(\"scroll\", {duration: 500, axis: \"x\"})\r\n\t//\t\t\t\t\t\t\t\t.velocity({opacity: 1}, 500, function() {\r\n\t//\t\t\t\t\t\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyLeft]\r\n\t//\t\t\t\t\t\t\t\t\t - ($details.offset().left + scrollOffset)) <= 100, true, \"Page scroll left was chained.\");\r\n\t//\r\n\t//\t\t\t\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t\t\t\t});\r\n\t//\t\t\t\t\t\t});\r\n\t//\t\t\t\t});\r\n\t//\t\t});\r\n});\r\n\r\n/* Element scrolling. */\r\nQUnit.skip(\"Scroll (Element)\", (assert) => {\r\n\t//\tvar done = assert.async(2),\r\n\t//\t\t$scrollTarget1 = $(\"\\\r\n\t//\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\r\n\t//\t\t\t\t\t\taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\r\n\t//\t\t\t\t\t\taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\r\n\t//\t\t\t\t\t\taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\r\n\t//\t\t\t\t\t\taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\tStop #1\\\r\n\t//\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\tStop #2\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t
\\\r\n\t//\t\t\t\t\");\r\n\t//\r\n\t//\tassert.expect(2);\r\n\t//\t$scrollTarget1\r\n\t//\t\t.css({position: \"absolute\", backgroundColor: \"white\", top: 100, left: \"50%\", width: 500, height: 100, overflowY: \"scroll\"})\r\n\t//\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t/* Test with a jQuery object container. */\r\n\t//\t$(\"#scrollerChild1\").velocity(\"scroll\", {\r\n\t//\t\tcontainer: $(\"#scroller\"), duration: 750, complete: function() {\r\n\t//\t\t\t/* Test with a raw DOM element container. */\r\n\t//\t\t\t$(\"#scrollerChild2\").velocity(\"scroll\", {\r\n\t//\t\t\t\tcontainer: $(\"#scroller\")[0], duration: 750, complete: function() {\r\n\t//\t\t\t\t\t/* This test is purely visual. */\r\n\t//\t\t\t\t\tassert.ok(true);\r\n\t//\r\n\t//\t\t\t\t\t$scrollTarget1.remove();\r\n\t//\r\n\t//\t\t\t\t\tvar $scrollTarget2 = $(\"\\\r\n\t//\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tStop #1\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tStop #2\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\");\r\n\t//\r\n\t//\t\t\t\t\t$scrollTarget2\r\n\t//\t\t\t\t\t\t.css({position: \"absolute\", backgroundColor: \"white\", top: 100, left: \"50%\", width: 100, height: 500, overflowX: \"scroll\"})\r\n\t//\t\t\t\t\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t\t\t\t\t/* Test with a jQuery object container. */\r\n\t//\t\t\t\t\t$(\"#scrollerChild2\").velocity(\"scroll\", {\r\n\t//\t\t\t\t\t\taxis: \"x\", container: $(\"#scroller\"), duration: 750, complete: function() {\r\n\t//\t\t\t\t\t\t\t/* Test with a raw DOM element container. */\r\n\t//\t\t\t\t\t\t\t$(\"#scrollerChild1\").velocity(\"scroll\", {\r\n\t//\t\t\t\t\t\t\t\taxis: \"x\", container: $(\"#scroller\")[0], duration: 750, complete: function() {\r\n\t//\t\t\t\t\t\t\t\t\t/* This test is purely visual. */\r\n\t//\t\t\t\t\t\t\t\t\tassert.ok(true);\r\n\t//\r\n\t//\t\t\t\t\t\t\t\t\t$scrollTarget2.remove();\r\n\t//\r\n\t//\t\t\t\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t\t\t\t}\r\n\t//\t\t\t\t\t\t\t});\r\n\t//\t\t\t\t\t\t}\r\n\t//\t\t\t\t\t});\r\n\t//\r\n\t//\t\t\t\t\tdone();\r\n\t//\t\t\t\t}\r\n\t//\t\t\t});\r\n\t//\t\t}\r\n\t//\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultOptions, defaultProperties, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Stop\", async (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), \"stop\");\r\n\t\tassert.ok(true, \"Calling on an element that isn't animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, defaultProperties, defaultOptions);\r\n\t\tVelocity($target, {top: 0}, defaultOptions);\r\n\t\tVelocity($target, {width: 0}, defaultOptions);\r\n\t\tVelocity($target, \"stop\");\r\n\t\tassert.ok(true, \"Calling on an element that is animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\tstartOpacity = getPropertyValue($target, \"opacity\");\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, defaultOptions);\r\n\t\tawait sleep(defaultOptions.duration as number / 2);\r\n\t\tVelocity($target, \"stop\");\r\n\t\tassert.close(parseFloat(getPropertyValue($target, \"opacity\")), parseFloat(startOpacity) / 2, 0.1, \"Animation runs until stopped.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tdelay: 1000,\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tawait sleep(500);\r\n\t\tVelocity($target, \"stop\");\r\n\t\tassert.notOk(begin, \"Stop animation before delay ends.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet complete1 = false,\r\n\t\t\tcomplete2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test1\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete1 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test2\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"stop\", \"test1\");\r\n\t\tawait sleep(defaultOptions.duration as number * 2);\r\n\t\tassert.ok(complete2, \"Stop animation with correct queue.\");\r\n\t\tassert.notOk(complete1, \"Don't stop animation with wrong queue.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin1 = false,\r\n\t\t\tbegin2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin1 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, {width: \"500px\"}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"stop\", true);\r\n\t\tawait sleep(defaultOptions.duration as number * 2);\r\n\t\tassert.notOk(begin1 || begin2, \"Stop 'true' stops all animations.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\tanim = Velocity($target, {opacity: [0, 1]}, {\r\n\t\t\t\tqueue: \"test\",\r\n\t\t\t\tbegin() {\r\n\t\t\t\t\tbegin1 = true;\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\tlet begin1 = false,\r\n\t\t\tbegin2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tanim.velocity(\"stop\");\r\n\t\tawait sleep(defaultOptions.duration as number * 2);\r\n\t\tassert.notOk(begin1, \"Stop without arguments on a chain stops chain animations.\");\r\n\t\tassert.ok(begin2, \"Stop without arguments on a chain doesn't stop other animations.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Tween\", (assert) => {\r\n\tconst $target1 = getTarget(),\r\n\t\tstartOpacity = $target1.style.opacity;\r\n\r\n\tassert.expect(11);\r\n\r\n\tassert.raises(() => (Velocity as any)(\"tween\", \"invalid\"), \"Invalid percentComplete throws an error.\");\r\n\tassert.raises(() => (Velocity as any)([$target1, $target1], \"tween\", \"invalid\"), \"Passing more than one target throws an error.\");\r\n\tassert.raises(() => (Velocity as any)(\"tween\", 0, [\"invalid\"]), \"Invalid propertyMap throws an error.\");\r\n\tassert.raises(() => (Velocity as any)(\"tween\", 0, \"invalid\", 1), \"Property without an element must be forcefed or throw an error.\");\r\n\r\n\tassert.equal($target1.velocity(\"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"0.5\", \"Calling on an chain returns the correct value.\");\r\n\tassert.equal(Velocity($target1, \"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"0.5\", \"Calling with an element returns the correct value.\");\r\n\tassert.equal(Velocity(\"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"0.5\", \"Calling without an element returns the correct value.\");\r\n\tassert.equal($target1.style.opacity, startOpacity, \"Ensure that the element is not altered.\");\r\n\r\n\tassert.equal(typeof Velocity($target1, \"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"string\", \"Calling a single property returns a value.\");\r\n\tassert.equal(typeof Velocity($target1, \"tween\", 0.5, {opacity: [1, 0]}, \"linear\"), \"object\", \"Calling a propertiesMap returns an object.\");\r\n\tassert.deepEqual($target1.velocity(\"tween\", 0.5, {opacity: [1, 0]}, \"linear\"), Velocity($target1, \"tween\", 0.5, {opacity: [1, 0]}, \"linear\"),\r\n\t\t\"Calling directly returns the same as a chain.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"Feature\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"'velocity-animating' Classname\", (assert) => {\r\n\tconst done = assert.async(1);\r\n\r\n\tVelocity(getTarget(), defaultProperties, {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.equal(/velocity-animating/.test(elements[0].className), true, \"Class added.\");\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.equal(/velocity-animating/.test(elements[0].className), false, \"Class removed.\");\r\n\t\t},\r\n\t})\r\n\t\t.then(done);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Colors (Shorthands)\", (assert) => {\r\n\tconst $target = getTarget();\r\n\r\n\tVelocity($target, {borderColor: \"#7871c2\", color: [\"#297dad\", \"spring\", \"#5ead29\"]});\r\n\r\n\t//\tassert.equal(Data($target).style.borderColorRed.endValue, 120, \"Hex #1a component.\");\r\n\t//\tassert.equal(Data($target).style.borderColorGreen.endValue, 113, \"Hex #1b component.\");\r\n\t//\tassert.equal(Data($target).style.borderColorBlue.endValue, 194, \"Hex #1c component.\");\r\n\t//\tassert.equal(Data($target).style.colorRed.easing, \"spring\", \"Per-property easing.\");\r\n\t//\tassert.equal(Data($target).style.colorRed.startValue, 94, \"Forcefed hex #2a component.\");\r\n\t//\tassert.equal(Data($target).style.colorGreen.startValue, 173, \"Forcefed hex #2b component.\");\r\n\t//\tassert.equal(Data($target).style.colorBlue.startValue, 41, \"Forcefed hex #2c component.\");\r\n\t//\tassert.equal(Data($target).style.colorRed.endValue, 41, \"Hex #3a component.\");\r\n\t//\tassert.equal(Data($target).style.colorGreen.endValue, 125, \"Hex #3b component.\");\r\n\t//\tassert.equal(Data($target).style.colorBlue.endValue, 173, \"Hex #3c component.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, defaultStyles, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Forcefeeding\", (assert) => {\r\n\t/* Note: Start values are always converted into pixels. W test the conversion ratio we already know to avoid additional work. */\r\n\tconst testStartWidth = \"1rem\",\r\n\t\ttestStartWidthToPx = \"16px\",\r\n\t\ttestStartHeight = \"10px\",\r\n\t\t$target = getTarget();\r\n\r\n\tVelocity($target, {\r\n\t\twidth: [100, \"linear\", testStartWidth],\r\n\t\theight: [100, testStartHeight],\r\n\t\topacity: [defaultProperties.opacity as any, \"easeInQuad\"],\r\n\t});\r\n\r\n\tassert.equal(Data($target).cache.width, parseFloat(testStartWidthToPx), \"Forcefed value #1 passed to tween.\");\r\n\tassert.equal(Data($target).cache.height, parseFloat(testStartHeight), \"Forcefed value #2 passed to tween.\");\r\n\tassert.equal(Data($target).cache.opacity, defaultStyles.opacity, \"Easing was misinterpreted as forcefed value.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {defaultOptions, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Promises\", (assert) => {\r\n\tconst done = assert.async(9),\r\n\t\tstart = getNow();\r\n\tlet result: VelocityResult;\r\n\r\n\tassert.expect(9);\r\n\r\n\t/**********************\r\n\t Invalid Arguments\r\n\t **********************/\r\n\r\n\t((Velocity as any)() as Promise)\r\n\t\t.then(() => {\r\n\t\t\tassert.notOk(true, \"Calling with no arguments should reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(true, \"Calling with no arguments should reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tVelocity(getTarget() as any)\r\n\t\t.then(() => {\r\n\t\t\tassert.notOk(true, \"Calling with no properties should reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(true, \"Calling with no properties should reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tVelocity(getTarget(), {})\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Calling with empty properties should not reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.notOk(true, \"Calling with empty properties should not reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tVelocity(getTarget(), {}, defaultOptions.duration)\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Calling with empty properties + duration should not reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.notOk(true, \"Calling with empty properties + duration should not reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\t/* Invalid arguments: Ensure an error isn't thrown. */\r\n\tVelocity(getTarget(), {} as any, \"fakeArg1\", \"fakeArg2\")\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Calling with invalid arguments should reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.notOk(true, \"Calling with invalid arguments should reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, defaultOptions);\r\n\tresult\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.length, 1, \"Calling with a single element fulfills with a single element array.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Calling with a single element fulfills with a single element array.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\tresult.velocity(defaultProperties)\r\n\t\t.then((elements) => {\r\n\t\t\tassert.ok(getNow() - start > 2 * (defaultOptions.duration as number), \"Queued call fulfilled after correct delay.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Queued call fulfilled after correct delay.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tresult = Velocity([getTarget(), getTarget()], defaultProperties, defaultOptions);\r\n\tresult\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.length, 2, \"Calling with multiple elements fulfills with a multiple element array.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Calling with multiple elements fulfills with a multiple element array.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tconst anim = Velocity(getTarget(), defaultProperties, defaultOptions);\r\n\r\n\tanim\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(getNow() - start < (defaultOptions.duration as number), \"Stop call fulfilled after correct delay.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Stop call fulfilled after correct delay.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\tanim.velocity(\"stop\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Sequences\", (assert) => {\r\n\t//\tvar done = assert.async(2),\r\n\t//\t\t$target1 = getTarget(),\r\n\t//\t\t$target2 = getTarget(),\r\n\t//\t\tredirectOptions = {duration: 1500};\r\n\t//\r\n\t//\t((window as any).jQuery || (window as any).Zepto || window).Velocity.Redirects.test = function(element, options, elementIndex, elementsLength) {\r\n\t//\t\tif (elementIndex === 0) {\r\n\t//\t\t\tassert.deepEqual(element, $target1, \"Element passed through #1.\");\r\n\t//\t\t\tassert.deepEqual(options, redirectOptions, \"Options object passed through #1.\");\r\n\t//\t\t\tassert.equal(elementIndex, 0, \"Element index passed through #1.\");\r\n\t//\t\t\tassert.equal(elementsLength, 2, \"Elements length passed through #1.\");\r\n\t//\r\n\t//\t\t\tdone();\r\n\t//\t\t} else if (elementIndex === 1) {\r\n\t//\t\t\tassert.deepEqual(element, $target2, \"Element passed through #2.\");\r\n\t//\t\t\tassert.deepEqual(options, redirectOptions, \"Options object passed through #2.\");\r\n\t//\t\t\tassert.equal(elementIndex, 1, \"Element index passed through #2.\");\r\n\t//\t\t\tassert.equal(elementsLength, 2, \"Elements length passed through #2.\");\r\n\t//\r\n\t//\t\t\tdone();\r\n\t//\t\t}\r\n\t//\t};\r\n\t//\r\n\t//\tVelocity([$target1, $target2], \"test\", redirectOptions);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Value Functions\", (assert) => {\r\n\tconst testWidth = 10,\r\n\t\t$target1 = getTarget(),\r\n\t\t$target2 = getTarget();\r\n\r\n\tVelocity([$target1, $target2], {\r\n\t\twidth(i, total) {\r\n\t\t\treturn (i + 1) / total * testWidth;\r\n\t\t},\r\n\t});\r\n\r\n\tassert.equal(Data($target1).cache.width, parseFloat(testWidth as any) / 2, \"Function value #1 passed to tween.\");\r\n\tassert.equal(Data($target2).cache.width, parseFloat(testWidth as any), \"Function value #2 passed to tween.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"UI Pack\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Packaged Effect: slideUp/Down\", (assert) => {\r\n\tconst done = assert.async(4),\r\n\t\t$target1 = getTarget(),\r\n\t\t$target2 = getTarget(),\r\n\t\tinitialStyles = {\r\n\t\t\tdisplay: \"none\",\r\n\t\t\tpaddingTop: \"123px\",\r\n\t\t};\r\n\r\n\t$target1.style.display = initialStyles.display;\r\n\t$target1.style.paddingTop = initialStyles.paddingTop;\r\n\r\n\tVelocity($target1, \"slideDown\", {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target1], \"slideDown: Begin callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target1], \"slideDown: Complete callback returned.\");\r\n\t\t\t//\t\t\tassert.equal(getPropertyValue($target1, \"display\"), Values.getDisplayType($target1), \"slideDown: display set to default.\");\r\n\t\t\tassert.notEqual(getPropertyValue($target1, \"height\"), 0, \"slideDown: height set.\");\r\n\t\t\tassert.equal(getPropertyValue($target1, \"paddingTop\"), initialStyles.paddingTop, \"slideDown: paddingTop set.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\t//\t}).then(function(elements) {\r\n\t\t//\t\tassert.deepEqual(elements, [$target1], \"slideDown: Promise fulfilled.\");\r\n\t\t//\r\n\t\t//\t\tdone();\r\n\t});\r\n\r\n\tVelocity($target2, \"slideUp\", {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target2], \"slideUp: Begin callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target2], \"slideUp: Complete callback returned.\");\r\n\t\t\tassert.equal(getPropertyValue($target2, \"display\"), 0, \"slideUp: display set to none.\");\r\n\t\t\tassert.notEqual(getPropertyValue($target2, \"height\"), 0, \"slideUp: height reset.\");\r\n\t\t\tassert.equal(getPropertyValue($target1, \"paddingTop\"), initialStyles.paddingTop, \"slideUp: paddingTop reset.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\t//\t}).then(function(elements) {\r\n\t\t//\t\tassert.deepEqual(elements, [$target2], \"slideUp: Promise fulfilled.\");\r\n\t\t//\r\n\t\t//\t\tdone();\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {completeCheckDuration, defaultOptions, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Call Options\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\tUICallOptions1 = {\r\n\t\t\tdelay: 123,\r\n\t\t\tduration: defaultOptions.duration,\r\n\t\t\teasing: \"spring\", // Should get ignored\r\n\t\t},\r\n\t\t$target1 = getTarget();\r\n\r\n\t//assert.expect(1);\r\n\tVelocity($target1, \"transition.slideLeftIn\", UICallOptions1);\r\n\r\n\tsetTimeout(() => {\r\n\t\t// Note: We can do this because transition.slideLeftIn is composed of a single call.\r\n\t\t//\t\tassert.equal(Data($target1).opts.delay, UICallOptions1.delay, \"Whitelisted option passed in.\");\r\n\t\t//\t\tassert.notEqual(Data($target1).opts.easing, UICallOptions1.easing, \"Non-whitelisted option not passed in #1a.\");\r\n\t\t//\t\tassert.equal(!/velocity-animating/.test(Data($target1).className), true, \"Duration option passed in.\");\r\n\r\n\t\tdone();\r\n\t}, completeCheckDuration);\r\n\r\n\tconst UICallOptions2 = {\r\n\t\tstagger: 100,\r\n\t\tduration: defaultOptions.duration,\r\n\t\tbackwards: true,\r\n\t};\r\n\r\n\tconst $targets = [getTarget(), getTarget(), getTarget()];\r\n\tVelocity($targets, \"transition.slideLeftIn\", UICallOptions2);\r\n\r\n\tsetTimeout(() => {\r\n\t\t//\t\tassert.equal(Data($targets[0]).opts.delay, UICallOptions2.stagger * 2, \"Backwards stagger delay passed in #1a.\");\r\n\t\t//\t\tassert.equal(Data($targets[1]).opts.delay, UICallOptions2.stagger * 1, \"Backwards stagger delay passed in #1b.\");\r\n\t\t//\t\tassert.equal(Data($targets[2]).opts.delay, UICallOptions2.stagger * 0, \"Backwards stagger delay passed in #1c.\");\r\n\r\n\t\tdone();\r\n\t}, completeCheckDuration);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Callbacks\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\t$targets = [getTarget(), getTarget()];\r\n\r\n\tassert.expect(3);\r\n\tVelocity($targets, \"transition.bounceIn\", {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.deepEqual(elements, $targets, \"Begin callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.deepEqual(elements, $targets, \"Complete callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\t//\t}).then(function(elements) {\r\n\t\t//\t\tassert.deepEqual(elements, $targets, \"Promise fulfilled.\");\r\n\t\t//\r\n\t\t//\t\tdone();\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, completeCheckDuration, defaultOptions, getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"In/Out\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\t$target1 = getTarget(),\r\n\t\t$target2 = getTarget(),\r\n\t\t$target3 = getTarget(),\r\n\t\t$target4 = getTarget(),\r\n\t\t$target5 = getTarget(),\r\n\t\t$target6 = getTarget();\r\n\r\n\tVelocity($target1, \"transition.bounceIn\", defaultOptions.duration);\r\n\r\n\tVelocity($target2, \"transition.bounceIn\", {duration: defaultOptions.duration, display: \"inline\"});\r\n\r\n\tVelocity($target3, \"transition.bounceOut\", defaultOptions.duration);\r\n\r\n\tVelocity($target4, \"transition.bounceOut\", {duration: defaultOptions.duration, display: null});\r\n\r\n\t$target5.style.visibility = \"hidden\";\r\n\tVelocity($target5, \"transition.bounceIn\", {duration: defaultOptions.duration, visibility: \"visible\"});\r\n\r\n\t$target6.style.visibility = \"visible\";\r\n\tVelocity($target6, \"transition.bounceOut\", {duration: defaultOptions.duration, visibility: \"hidden\"});\r\n\r\n\tassert.expect(8);\r\n\tsetTimeout(() => {\r\n\t\tassert.notEqual(getPropertyValue($target3, \"display\"), 0, \"Out: display not prematurely set to none.\");\r\n\t\tassert.notEqual(getPropertyValue($target6, \"visibility\"), \"hidden\", \"Out: visibility not prematurely set to hidden.\");\r\n\r\n\t\tdone();\r\n\t}, asyncCheckDuration);\r\n\r\n\tsetTimeout(() => {\r\n\t\t//\t\tassert.equal(getPropertyValue($target1, \"display\"), Values.getDisplayType($target1), \"In: display set to default.\");\r\n\t\tassert.equal(getPropertyValue($target2, \"display\"), \"inline\", \"In: Custom inline value set.\");\r\n\r\n\t\tassert.equal(getPropertyValue($target3, \"display\"), 0, \"Out: display set to none.\");\r\n\t\t//\t\tassert.equal(getPropertyValue($target4, \"display\"), Values.getDisplayType($target3), \"Out: No display value set.\");\r\n\r\n\t\tassert.equal(getPropertyValue($target5, \"visibility\"), \"visible\", \"In: visibility set to visible.\");\r\n\t\tassert.equal(getPropertyValue($target6, \"visibility\"), \"hidden\", \"Out: visibility set to hidden.\");\r\n\r\n\t\tdone();\r\n\t}, completeCheckDuration);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"RegisterEffect\", (assert) => {\r\n//\tconst done = assert.async(1),\r\n//\t\teffectDefaultDuration = 800;\r\n//\r\n//\tassert.expect(2);\r\n//\tVelocity.RegisterEffect(\"callout.twirl\", {\r\n//\t\tdefaultDuration: effectDefaultDuration,\r\n//\t\tcalls: [\r\n//\t\t\t[{rotateZ: 1080}, 0.5],\r\n//\t\t\t[{scaleX: 0.5}, 0.25, {easing: \"spring\"}],\r\n//\t\t\t[{scaleX: 1}, 0.25, {easing: \"spring\"}],\r\n//\t\t],\r\n//\t});\r\n//\r\n//\tconst $target1 = getTarget();\r\n//\tVelocity($target1, \"callout.twirl\");\r\n//\r\n//\tsetTimeout(() => {\r\n//\t\tassert.equal(parseFloat(getPropertyValue($target1, \"rotateZ\") as string), 1080, \"First call's property animated.\");\r\n//\t\tassert.equal(parseFloat(getPropertyValue($target1, \"scaleX\") as string), 1, \"Last call's property animated.\");\r\n//\r\n//\t\tdone();\r\n//\t}, effectDefaultDuration * 1.5);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {defaultProperties, getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"RunSequence\", (assert) => {\r\n\t//\r\n\t//\tvar done = assert.async(1),\r\n\t//\t\t$target1 = getTarget(),\r\n\t//\t\t$target2 = getTarget(),\r\n\t//\t\t$target3 = getTarget(),\r\n\t//\t\tmySequence = [\r\n\t//\t\t\t{elements: $target1, properties: {opacity: defaultProperties.opacity}},\r\n\t//\t\t\t{elements: $target2, properties: {height: defaultProperties.height}},\r\n\t//\t\t\t{\r\n\t//\t\t\t\telements: $target3, properties: {width: defaultProperties.width}, options: {\r\n\t//\t\t\t\t\tdelay: 100,\r\n\t//\t\t\t\t\tsequenceQueue: false,\r\n\t//\t\t\t\t\tcomplete: function() {\r\n\t//\t\t\t\t\t\tassert.equal(parseFloat(getPropertyValue($target1, \"opacity\") as string), defaultProperties.opacity, \"First call's property animated.\");\r\n\t//\t\t\t\t\t\tassert.equal(parseFloat(getPropertyValue($target2, \"height\") as string), defaultProperties.height, \"Second call's property animated.\");\r\n\t//\t\t\t\t\t\tassert.equal(parseFloat(getPropertyValue($target3, \"width\") as string), defaultProperties.width, \"Last call's property animated.\");\r\n\t//\r\n\t//\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t}\r\n\t//\t\t\t\t}\r\n\t//\t\t\t}\r\n\t//\t\t];\r\n\t//\r\n\t//\tassert.expect(3);\r\n\t//\tVelocity.RunSequence(mySequence);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"Properties\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {HTMLorSVGElement} from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"GenericReordering\", (assert) => {\r\n\t//\tfunction genericReordering(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\t//\t\tif (propertyValue === undefined) {\r\n\t//\t\t\tpropertyValue = Velocity(element, \"style\", \"textShadow\");\r\n\t//\t\t\tconst split = propertyValue.split(/\\s/g),\r\n\t//\t\t\t\tfirstPart = split[0];\r\n\t//\t\t\tlet newValue = \"\";\r\n\t//\r\n\t//\t\t\tif (Velocity.CSS.ColorNames[firstPart]) {\r\n\t//\t\t\t\tsplit.shift();\r\n\t//\t\t\t\tsplit.push(firstPart);\r\n\t//\t\t\t\tnewValue = split.join(\" \");\r\n\t//\t\t\t} else if (firstPart.match(/^#|^hsl|^rgb|-gradient/)) {\r\n\t//\t\t\t\tconst matchedString = propertyValue.match(/(hsl.*\\)|#[\\da-fA-F]+|rgb.*\\)|.*gradient.*\\))\\s/g)[0];\r\n\t//\r\n\t//\t\t\t\tnewValue = propertyValue.replace(matchedString, \"\") + \" \" + matchedString.trim();\r\n\t//\t\t\t} else {\r\n\t//\t\t\t\tnewValue = propertyValue;\r\n\t//\t\t\t}\r\n\t//\t\t\treturn newValue;\r\n\t//\t\t}\r\n\t//\t}\r\n\t//\r\n\t//\tVelocity(\"registerNormalization\", \"Element\", \"genericReordering\", genericReordering);\r\n\t//\r\n\t//\tlet tests = [\r\n\t//\t\t{\r\n\t//\t\t\ttest: \"hsl(16, 100%, 66%) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px hsl(16, 100%, 66%)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"-webkit-linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px -webkit-linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"-o-linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px -o-linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"-moz-linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px -moz-linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"red 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(255,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"#000000 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"rgb(0, 0, 0) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"rgba(0, 0, 0, 1) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"1px 1px 1px rgb(0, 0, 0)\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t},\r\n\t//\t];\r\n\t//\r\n\t//\tfor (let test of tests) {\r\n\t//\t\tlet element = getTarget();\r\n\t//\r\n\t//\t\telement.velocity(\"style\", \"textShadow\", test.test);\r\n\t//\t\tassert.equal(element.velocity(\"style\", \"genericReordering\"), test.result, test.test);\r\n\t//\t}\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Display\", (assert) => {\r\n\tconst done = assert.async(5);\r\n\r\n\tVelocity(getTarget(), \"style\", \"display\", \"none\")\r\n\t\t.velocity({display: \"block\"}, {\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"block\", \"Display:'block' was set immediately.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t}),\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), \"style\", \"display\", \"none\")\r\n\t\t.velocity(\"style\", \"display\", \"auto\")\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements[0].style.display, \"block\", \"Display:'auto' was understood.\");\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"block\", \"Display:'auto' was cached as 'block'.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), \"style\", \"display\", \"none\")\r\n\t\t.velocity(\"style\", \"display\", \"\")\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"block\", \"Display:'' was reset correctly.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), {display: \"none\"}, {\r\n\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\tassert.notEqual(elements.velocity(\"style\", \"display\"), \"none\", \"Display:'none' was not set immediately.\");\r\n\r\n\t\t\tdone();\r\n\t\t}),\r\n\t})\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"none\", \"Display:'none' was set upon completion.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Visibility\", (assert) => {\r\n\tconst done = assert.async(4);\r\n\r\n\tVelocity(getTarget(), \"style\", \"visibility\", \"hidden\")\r\n\t\t.velocity({visibility: \"visible\"}, {\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"visibility\"), \"visible\", \"Visibility:'visible' was set immediately.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t}),\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), \"style\", \"visibility\", \"hidden\")\r\n\t\t.velocity(\"style\", \"visibility\", \"\")\r\n\t\t.then((elements) => {\r\n\t\t\t// NOTE: The test elements inherit \"hidden\", so while illogical it\r\n\t\t\t// is in fact correct.\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"visibility\"), \"hidden\", \"Visibility:'' was reset correctly.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), {visibility: \"hidden\"}, {\r\n\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\tassert.notEqual(elements.velocity(\"style\", \"visibility\"), \"visible\", \"Visibility:'hidden' was not set immediately.\");\r\n\r\n\t\t\tdone();\r\n\t\t}),\r\n\t})\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"visibility\"), \"hidden\", \"Visibility:'hidden' was set upon completion.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n"],"names":["isMobile","test","navigator","userAgent","isAndroid","defaultStyles","opacity","width","height","marginBottom","colorGreen","textShadowBlur","defaultProperties","String","defaultOptions","queue","duration","easing","begin","complete","progress","loop","delay","mobileHA","$","window","jQuery","Zepto","$qunitStage","document","getElementById","asyncCheckDuration","completeCheckDuration","IE","documentMode","i","div","createElement","innerHTML","getElementsByTagName","length","undefined","targets","asyncCount","QUnit","config","reorder","element","startValues","each","property","startValue","style","jquery","velocityData","performance","now","Date","Velocity","className","color","textShadow","appendChild","push","applyStartValues","func","done","result","apply","arguments","ms","Promise","resolve","setTimeout","assert","count","callback","oldCount","async","testDone","querySelectorAll","velocity","removeChild","pop","asyncTests","defaults","reset","details","console","log","total","failed","passed","runtime","module","testComplete","testDuration","testEasing","testOptions","expect","getTarget","ok","animations","equal","options","elements","properties","newProperties","then","Data","cache","todo","testStartValues","paddingLeft","paddingRight","marginLeft","marginTop","lineHeight","wordSpacing","backgroundColor","$target1","$target2","parseFloat","testPropertiesEndNoConvert","$target3","testPropertiesEndConvert","parentWidth","clientWidth","parentHeight","clientHeight","parentFontSize","remSize","body","$target4","parseInt","Math","floor","parentElement","offsetWidth","testPropertiesTRBL","left","$TRBLContainer","setAttribute","$target5","position","round","$target","sleep","getPropertyValue","$targetSet","deepEqual","testDelay","start","getNow","activeCall","close","success","e","easingBezierArray","easingBezierTestPercent","easingBezierTestValue","animation","easingSpringRK4Array","easingSpringRK4TestPercent","easingSpringRK4TestValue","easingStepArray","easingStepTestPercent","easingStepTestValue","once","frameRates","testFrame","frameRate","counter","fpsLimit","lastPercentComplete","percentComplete","msRemaining","testQueue","ignore","data","anim1","anim2","queueList","anim3","repeat","startDelay","speed","__start","actual","expected","__count","sync","notOk","top","complete1","complete2","skip","startOpacity","begin1","begin2","anim","raises","borderColor","testStartWidth","testStartWidthToPx","testStartHeight","testWidth","initialStyles","display","paddingTop","notEqual","UICallOptions1","UICallOptions2","stagger","backwards","$targets","$target6","visibility"],"mappings":";;;;;;;;;;;;;;CA2BO,IAAMA,WAAW,iEAAiEC,IAAjE,CAAsEC,UAAUC,SAAhF,CAAjB;CAAA,IACNC,YAAY,WAAWH,IAAX,CAAgBC,UAAUC,SAA1B,CADN;CAAA,IAENE,gBAAgB;CACfC,aAAS,CADM;CAEfC,WAAO,CAFQ;CAGfC,YAAQ,CAHO;CAIfC,kBAAc,CAJC;CAKfC,gBAAY,GALG;CAMfC,oBAAgB;CAND,CAFV;CAAA,IAUNC,oBAAwC;CACvCN,aAASO,OAAOR,cAAcC,OAAd,GAAwB,CAA/B,CAD8B;CAEvCC,WAAOF,cAAcE,KAAd,GAAsB,CAAtB,GAA0B,IAFM;CAGvCC,YAAQH,cAAcG,MAAd,GAAuB,CAAvB,GAA2B;CAHI,CAVlC;CAAA,IAeNM,iBAAkC;CACjCC,WAAO,EAD0B;CAEjCC,cAAU,GAFuB;CAGjCC,YAAQ,OAHyB;CAIjCC,WAAO,IAJ0B;CAKjCC,cAAU,IALuB;CAMjCC,cAAU,IANuB;CAOjCC,UAAM,KAP2B;CAQjCC,WAAO,CAR0B;CASjCC,cAAU;CATuB,CAf5B;CAAA,IA0BNC,IAAMC,OAAeC,MAAf,IAA0BD,OAAeE,KA1BzC;CAAA,IA2BNC,cAAcC,SAASC,cAAT,CAAwB,aAAxB,CA3BR;CAAA,IA4BNC,qBAAsBjB,eAAeE,QAAf,GAAqC,CA5BrD;CAAA,IA6BNgB,wBAAyBlB,eAAeE,QAAf,GAAqC,CA7BxD;CAAA,IA8BNiB,KAAM;CACL,QAAKJ,SAAiBK,YAAtB,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CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CA5DD;CA8DA;CACA9B,MAAMwJ,IAAN,CAAW,kBAAX,EAA+B,UAAC1H,MAAD;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CA/GD;;;CChEA9B,MAAM3C,IAAN,CAAW,MAAX,EAAmB,UAAOyE,MAAP;CAAA;;;;;;;CAClBU,mCAAWV,MAAX,EAAmB,CAAnB,EAAsB,UAACR,IAAD;CACrBR,qCAAS0C,WAAT,EAAsB,MAAtB;CACA1B,mCAAO2B,EAAP,CAAU,IAAV,EAAgB,oEAAhB;CAEAnC;CACA,yBALD;CAOAkB,mCAAWV,MAAX,EAAmB,CAAnB,EAAsB,UAACR,IAAD;CACrB,gCAAMgF,UAAU9C,WAAhB;CAEA1C,qCAASwF,OAAT,EAAkBtI,iBAAlB,EAAqCE,cAArC;CACA4C,qCAASwF,OAAT,EAAkB,EAAC+C,KAAK,CA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Af;CACA,KARF;CAUAR,aAAS0C,WAAT,EAAsB,EAACqH,YAAY,QAAb,EAAtB,EAA8C;CAC7CrM,kBAAUoJ,KAAK,UAAC/D,QAAD;CACd/B,mBAAOwI,QAAP,CAAgBzG,SAASxB,QAAT,CAAkB,OAAlB,EAA2B,YAA3B,CAAhB,EAA0D,SAA1D,EAAqE,8CAArE;CAEAf;CACA,SAJS;CADmC,KAA9C,EAOE0C,IAPF,CAOO,UAACH,QAAD;CACL/B,eAAO6B,KAAP,CAAaE,SAASxB,QAAT,CAAkB,OAAlB,EAA2B,YAA3B,CAAb,EAAuD,QAAvD,EAAiE,8CAAjE;CAEAf;CACA,KAXF;CAYA,CAlCD;;"} \ No newline at end of file +{"version":3,"file":"test.js","sources":["src/utilities.ts","src/1_Core/Arguments.ts","src/1_Core/End Value Caching.ts","src/1_Core/End Value Setting.ts","src/1_Core/Start Value Calculation.ts","src/1_Core/Unit Calculation.ts","src/2_Option/Option Begin.ts","src/2_Option/Option Complete.ts","src/2_Option/Option Delay.ts","src/2_Option/Option Easing.ts","src/2_Option/Option Fps Limit.ts","src/2_Option/Option Loop.ts","src/2_Option/Option Progress.ts","src/2_Option/Option Queue.ts","src/2_Option/Option Repeat.ts","src/2_Option/Option Speed.ts","src/2_Option/Option Sync.ts","src/3_Command/Command Finish.ts","src/3_Command/Command Pause + Resume.ts","src/3_Command/Command Reverse.ts","src/3_Command/Command Scroll.ts","src/3_Command/Command Stop.ts","src/3_Command/Command Tween.ts","src/4_Feature/_module.ts","src/4_Feature/Feature Classname.ts","src/4_Feature/Feature Colors.ts","src/4_Feature/Feature Forcefeeding.ts","src/4_Feature/Feature Promises.ts","src/4_Feature/Feature Sequences.ts","src/4_Feature/Feature Value Functions.ts","src/5_UIPack/Packaged Effect slideUp+Down.ts","src/5_UIPack/UI Pack Call Options.ts","src/5_UIPack/UI Pack Callbacks.ts","src/5_UIPack/UI Pack In+Out.ts","src/5_UIPack/UI Pack RegisterEffect.ts","src/5_UIPack/UI Pack RunSequence.ts","src/6_Properties/Normalization property value reordering.ts","src/6_Properties/Property Display.ts","src/6_Properties/Property Visibility.ts"],"sourcesContent":["/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {ElementData, VelocityOptions, VelocityProperties} from \"velocity-animate\";\r\n\r\ndeclare global {\r\n\tinterface QUnit {\r\n\t\ttodo(name: string, callback: (assert: Assert) => void): void;\r\n\t}\r\n\r\n\tinterface Assert {\r\n\t\tclose: {\r\n\t\t\t(actual: number, expected: number, maxDifference: number, message: string): void;\r\n\t\t\tpercent(actual: number, expected: number, maxPercentDifference: number, message: string): void;\r\n\t\t};\r\n\t\tnotClose: {\r\n\t\t\t(actual: number, expected: number, minDifference: number, message: string): void;\r\n\t\t\tpercent(actual: number, expected: number, minPercentDifference: number, message: string): void;\r\n\t\t};\r\n\t}\r\n}\r\n\r\nexport const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\r\n\tisAndroid = /Android/i.test(navigator.userAgent),\r\n\tdefaultStyles = {\r\n\t\topacity: 1,\r\n\t\twidth: 1,\r\n\t\theight: 1,\r\n\t\tmarginBottom: 1,\r\n\t\tcolorGreen: 200,\r\n\t\ttextShadowBlur: 3,\r\n\t},\r\n\tdefaultProperties: VelocityProperties = {\r\n\t\topacity: String(defaultStyles.opacity / 2),\r\n\t\twidth: defaultStyles.width * 2 + \"px\",\r\n\t\theight: defaultStyles.height * 2 + \"px\",\r\n\t},\r\n\tdefaultOptions: VelocityOptions = {\r\n\t\tqueue: \"\",\r\n\t\tduration: 300,\r\n\t\teasing: \"swing\",\r\n\t\tbegin: null,\r\n\t\tcomplete: null,\r\n\t\tprogress: null,\r\n\t\tloop: false,\r\n\t\tdelay: 0,\r\n\t\tmobileHA: true,\r\n\t},\r\n\t$ = ((window as any).jQuery || (window as any).Zepto),\r\n\t$qunitStage = document.getElementById(\"qunit-stage\"),\r\n\tasyncCheckDuration = (defaultOptions.duration as number) / 2,\r\n\tcompleteCheckDuration = (defaultOptions.duration as number) * 2,\r\n\tIE = (() => {\r\n\t\tif ((document as any).documentMode) {\r\n\t\t\treturn (document as any).documentMode as number;\r\n\t\t} else {\r\n\t\t\tfor (let i = 7; i > 0; i--) {\r\n\t\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\t\tdiv.innerHTML = ``;\r\n\t\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\t\tdiv = null;\r\n\r\n\t\t\t\t\treturn i;\r\n\t\t\t\t}\r\n\t\t\t\tdiv = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t})();\r\n\r\nconst targets: HTMLDivElement[] = [];\r\nlet asyncCount = 0;\r\n\r\nQUnit.config.reorder = false;\r\n\r\nexport function applyStartValues(element: HTMLElement, startValues: {[name: string]: string}) {\r\n\t$.each(startValues, (property, startValue) => {\r\n\t\telement.style[property] = startValue;\r\n\t});\r\n}\r\n\r\nexport function Data(element): ElementData {\r\n\treturn (element.jquery ? element[0] : element).velocityData;\r\n}\r\n\r\nexport function getNow(): number {\r\n\treturn performance && performance.now ? performance.now() : Date.now();\r\n}\r\n\r\nexport function getPropertyValue(element: HTMLElement, property: string): string {\r\n\treturn Velocity(element, \"style\", property);\r\n}\r\n\r\nexport function getTarget(startValues?: {[name: string]: string}): HTMLDivElement {\r\n\tconst div = document.createElement(\"div\") as HTMLDivElement;\r\n\r\n\tdiv.className = \"target\";\r\n\tdiv.style.opacity = String(defaultStyles.opacity);\r\n\tdiv.style.color = `rgb(125, ${defaultStyles.colorGreen}, 125)`;\r\n\tdiv.style.width = defaultStyles.width + \"px\";\r\n\tdiv.style.height = defaultStyles.height + \"px\";\r\n\tdiv.style.marginBottom = defaultStyles.marginBottom + \"px\";\r\n\tdiv.style.textShadow = `0px 0px ${defaultStyles.textShadowBlur}px red`;\r\n\t$qunitStage.appendChild(div);\r\n\ttargets.push(div);\r\n\tif (startValues) {\r\n\t\tapplyStartValues(div, startValues);\r\n\t}\r\n\r\n\treturn div;\r\n}\r\n\r\nexport function once(func): typeof func {\r\n\tlet done: boolean,\r\n\t\tresult: any;\r\n\r\n\treturn function(this: any) {\r\n\t\tif (!done) {\r\n\t\t\tresult = func.apply(this, arguments);\r\n\t\t\tfunc = done = true; // Don't care about type, just let the GC collect if possible\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n}\r\n\r\nexport function sleep(ms: number) {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n}\r\n\r\n/**\r\n * Create an asyn callback. Each callback must be independant of all others, and\r\n * gets it's own unique done() callback to use. This also requires a count of\r\n * the number of tests run, and the assert object used.\r\n * Call without any arguments to get a total count of tests requested.\r\n */\r\nexport function asyncTests(): number;\r\nexport function asyncTests(assert: Assert, count: number, callback: (done: () => void) => void): void;\r\nexport function asyncTests(assert?: Assert, count?: number, callback?: (done: () => void) => void): number {\r\n\tif (!assert) {\r\n\t\tconst oldCount = asyncCount;\r\n\r\n\t\tasyncCount = 0;\r\n\r\n\t\treturn oldCount;\r\n\t}\r\n\tconst done = assert.async(1);\r\n\r\n\tasyncCount += count;\r\n\tsetTimeout(() => {\r\n\t\tcallback(done);\r\n\t}, 1);\r\n}\r\n\r\nexport function isEmptyObject(variable): variable is {} {\r\n\tfor (const name in variable) {\r\n\t\tif (variable.hasOwnProperty(name)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nQUnit.testDone(() => {\r\n\ttry {\r\n\t\tdocument.querySelectorAll(\".velocity-animating\")\r\n\t\t\t.velocity(\"stop\");\r\n\t} catch {\r\n\t\t// We don't care if it fails.\r\n\t}\r\n\t// Free all targets requested by the current test.\r\n\twhile (targets.length) {\r\n\t\ttry {\r\n\t\t\t$qunitStage.removeChild(targets.pop());\r\n\t\t} catch {\r\n\t\t\t// We don't care if it fails.\r\n\t\t}\r\n\t}\r\n\t// Ensure we have reset the test counter.\r\n\tasyncTests();\r\n\t// Make sure Velocity goes back to defaults.\r\n\tVelocity.defaults.reset();\r\n});\r\n\r\n/* Cleanup */\r\nQUnit.done((details) => {\r\n\t//\t$(\".velocity-animating\").velocity(\"stop\");\r\n\tconsole.log(\"Total: \", details.total, \" Failed: \", details.failed, \" Passed: \", details.passed, \" Runtime: \", details.runtime);\r\n});\r\n\r\n/* Helpful redirect for testing custom and parallel queues. */\r\n// var $div2 = $(\"#DataBody-PropertiesDummy\");\r\n// $.fn.velocity.defaults.duration = 1000;\r\n// $div2.velocity(\"scroll\", { queue: \"test\" })\r\n// $div2.velocity({width: 100}, { queue: \"test\" })\r\n// $div2.velocity({ borderWidth: 50 }, { queue: \"test\" })\r\n// $div2.velocity({height: 20}, { queue: \"test\" })\r\n// $div2.velocity({marginLeft: 200}, { queue: \"test\" })\r\n// $div2.velocity({paddingTop: 60});\r\n// $div2.velocity({marginTop: 100});\r\n// $div2.velocity({paddingRight: 40});\r\n// $div2.velocity({marginTop: 0})\r\n// $div2.dequeue(\"test\")\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityOptions, VelocityResult} from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Arguments\", (assert) => {\r\n\tconst testComplete = () => {\r\n\t\t// Do nothing\r\n\t},\r\n\t\ttestDuration = 1000,\r\n\t\ttestEasing = \"easeInSine\",\r\n\t\ttestOptions: VelocityOptions = {\r\n\t\t\tduration: 123,\r\n\t\t\teasing: testEasing,\r\n\t\t\tcomplete: testComplete,\r\n\t\t};\r\n\tlet result: VelocityResult;\r\n\r\n\tassert.expect(18);\r\n\r\n\t/****************\r\n\t Overloading\r\n\t ****************/\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties);\r\n\tassert.ok(result.length,\r\n\t\t\"Overload variation #1a: Velocity(ELEMENT, {properties})\");\r\n\tassert.ok(result.velocity.animations.length,\r\n\t\t\"Overload variation #1b: Velocity(element, {PROPERTIES})\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #2a: Velocity(element, {properties}, DURATION)\");\r\n\tresult = Velocity(getTarget(), defaultProperties, \"slow\");\r\n\tassert.equal(result.velocity.animations[0].options.duration, 600,\r\n\t\t\"Overload variation #2b: Velocity(element, {properties}, DURATION)\");\r\n\tresult = Velocity(getTarget(), defaultProperties, \"normal\");\r\n\tassert.equal(result.velocity.animations[0].options.duration, 400,\r\n\t\t\"Overload variation #2c: Velocity(element, {properties}, DURATION)\");\r\n\tresult = Velocity(getTarget(), defaultProperties, \"fast\");\r\n\tassert.equal(result.velocity.animations[0].options.duration, 200,\r\n\t\t\"Overload variation #2d: Velocity(element, {properties}, DURATION)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testEasing);\r\n\tassert.equal(typeof result.velocity.animations[0].options.easing, \"function\",\r\n\t\t\"Overload variation #3: Velocity(element, {properties}, EASING)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testComplete);\r\n\tassert.equal(typeof result.velocity.animations[0].options.complete, \"function\",\r\n\t\t\"Overload variation #4: Velocity(element, {properties}, COMPLETE)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration, [0.42, 0, 0.58, 1]);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #5a: Velocity(element, {properties}, DURATION, easing)\");\r\n\tassert.equal(result.velocity.animations[0].options.easing(0.2, 0, 1), 0.0816598562658975,\r\n\t\t\"Overload variation #5b: Velocity(element, {properties}, duration, EASING)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration, testComplete);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #6a: Velocity(element, {properties}, DURATION, complete)\");\r\n\tassert.equal(result.velocity.animations[0].options.complete, testComplete,\r\n\t\t\"Overload variation #6b: Velocity(element, {properties}, duration, COMPLETE)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testDuration, testEasing, testComplete);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testDuration,\r\n\t\t\"Overload variation #7a: Velocity(element, {properties}, DURATION, easing, complete)\");\r\n\tassert.equal(typeof result.velocity.animations[0].options.easing, \"function\",\r\n\t\t\"Overload variation #7b: Velocity(element, {properties}, duration, EASING, complete)\");\r\n\tassert.equal(result.velocity.animations[0].options.complete, testComplete,\r\n\t\t\"Overload variation #7c: Velocity(element, {properties}, duration, easing, COMPLETE)\");\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, testOptions);\r\n\tassert.equal(result.velocity.animations[0].options.duration, testOptions.duration,\r\n\t\t\"Overload variation #8: Velocity(element, {properties}, {OPTIONS})\");\r\n\r\n\tVelocity({elements: [getTarget()], properties: defaultProperties, options: testOptions});\r\n\tassert.equal(result.velocity.animations[0].options.duration, testOptions.duration,\r\n\t\t\"Overload variation #9: Velocity({elements:[elements], properties:{properties}, options:{OPTIONS})\");\r\n\r\n\tVelocity({elements: [getTarget()], properties: \"stop\", options: testOptions});\r\n\tassert.equal(result.velocity.animations[0].options.duration, testOptions.duration,\r\n\t\t\"Overload variation #10: Velocity({elements:[elements], properties:\\\"ACTION\\\", options:{OPTIONS})\");\r\n\r\n\t//\tvar $target12 = getTarget();\r\n\t//\tVelocity($target12, {opacity: [0.75, \"spring\", 0.25]}, testDuration);\r\n\t//\tassert.equal(Data($target12).style.opacity.startValue, 0.25, \"Overload variation #10a.\");\r\n\t//\tassert.equal(Data($target12).style.opacity.easing, \"spring\", \"Overload variation #10b.\");\r\n\t//\tassert.equal(Data($target12).style.opacity.endValue, 0.75, \"Overload variation #10c.\");\r\n\r\n\t//\tvar $target13 = getTarget();\r\n\t//\tVelocity($target13, {opacity: [0.75, 0.25]}, testDuration);\r\n\t//\tassert.equal(Data($target13).style.opacity.startValue, 0.25, \"Overload variation #11a.\");\r\n\t//\tassert.equal(Data($target13).style.opacity.endValue, 0.75, \"Overload variation #11b.\");\r\n\r\n\t//\tvar $target14 = getTarget();\r\n\t//\tVelocity($target14, {opacity: [0.75, \"spring\"]}, testDuration);\r\n\t//\tassert.equal(Data($target14).style.opacity.endValue, 0.75, \"Overload variation #12a.\");\r\n\t//\tassert.equal(Data($target14).style.opacity.easing, \"spring\", \"Overload variation #12b.\");\r\n\r\n\t//\tif ($) {\r\n\t//\t\tvar $target17 = getTarget();\r\n\t//\t\t$($target17).velocity(defaultProperties, testOptions);\r\n\t//\t\tassert.deepEqual(Data($target17).opts, testOptions, \"$.fn.: Utility function variation #1: options object.\");\r\n\t//\r\n\t//\t\tvar $target18 = getTarget();\r\n\t//\t\t$($target18).velocity({properties: defaultProperties, options: testOptions});\r\n\t//\t\tassert.deepEqual(Data($target18).opts, testOptions, \"$.fn.: Utility function variation #2: single object.\");\r\n\t//\r\n\t//\t\tvar $target19 = getTarget();\r\n\t//\t\t$($target19).velocity(defaultProperties, testDuration, testEasing, testComplete);\r\n\t//\t\tassert.equal(Data($target19).opts.duration, testDuration, \"$.fn.: Utility function variation #2a.\");\r\n\t//\t\tassert.equal(Data($target19).opts.easing, testEasing, \"$.fn.: Utility function variation #2b.\");\r\n\t//\t\tassert.equal(Data($target19).opts.complete, testComplete, \"$.fn.: Utility function variation #2c.\");\r\n\t//\r\n\t//\t\tvar $target20 = getTarget();\r\n\t//\t\tassert.equal($($target20).length, $($target20).velocity(defaultProperties, testDuration, testEasing, testComplete)\r\n\t//\t\t.velocity(defaultProperties, testDuration, testEasing, testComplete).length, \"$.fn.: Elements passed back to the call stack.\");\r\n\t//\t\t// TODO: Should check in a better way - but the prototype chain is now extended with a Promise so a standard (non-length) comparison *will* fail\r\n\t//\t}\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"End Value Caching\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\tnewProperties = {height: \"50px\", width: \"250px\"};\r\n\r\n\tassert.expect(4);\r\n\r\n\t/* Called after the last call is complete (stale). Ensure that the newly-set (via $.css()) properties are used. */\r\n\tVelocity(getTarget(newProperties), defaultProperties)\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(Data(elements[0]).cache.width, defaultProperties.width, \"Stale end value #1 wasn't pulled.\");\r\n\t\t\tassert.equal(Data(elements[0]).cache.height, defaultProperties.height, \"Stale end value #2 wasn't pulled.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), defaultProperties)\r\n\t\t.velocity(newProperties)\r\n\t\t.then((elements) => {\r\n\t\t\t/* Chained onto a previous call (fresh). */\r\n\t\t\tassert.equal(Data(elements[0]).cache.width, newProperties.width, \"Chained end value #1 was pulled.\");\r\n\t\t\tassert.equal(Data(elements[0]).cache.height, newProperties.height, \"Chained end value #2 was pulled.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"End Value Setting\", (assert) => {\r\n\tconst done = assert.async(1);\r\n\r\n\t/* Standard properties. */\r\n\tVelocity(getTarget(), defaultProperties)\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(Velocity(elements[0], \"style\", \"width\"), defaultProperties.width, \"Standard end value #1 was set.\");\r\n\t\t\tassert.equal(Velocity(elements[0], \"style\", \"opacity\"), defaultProperties.opacity, \"Standard end value #2 was set.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {$qunitStage, applyStartValues, Data, defaultProperties, defaultStyles, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Start Value Calculation\", (assert) => {\r\n\tconst testStartValues = {\r\n\t\tpaddingLeft: \"10px\",\r\n\t\theight: \"100px\",\r\n\t\tpaddingRight: \"50%\",\r\n\t\tmarginLeft: \"100px\",\r\n\t\tmarginBottom: \"33%\",\r\n\t\tmarginTop: \"100px\",\r\n\t\tlineHeight: \"30px\",\r\n\t\twordSpacing: \"40px\",\r\n\t\tbackgroundColor: \"rgb(123,0,0)\",\r\n\t};\r\n\r\n\t/* Properties not previously defined on the element. */\r\n\tconst $target1 = getTarget();\r\n\r\n\tVelocity($target1, testStartValues);\r\n\tassert.equal(Data($target1).cache.paddingLeft, testStartValues.paddingLeft, \"Undefined standard start value was calculated.\");\r\n\tassert.equal(Data($target1).cache.backgroundColor, testStartValues.backgroundColor, \"Undefined start value hook was calculated.\");\r\n\r\n\t/* Properties previously defined on the element. */\r\n\tconst $target2 = getTarget();\r\n\r\n\tVelocity($target2, defaultProperties);\r\n\tassert.equal(Data($target2).cache.width, parseFloat(defaultStyles.width as any), \"Defined start value #1 was calculated.\");\r\n\tassert.equal(Data($target2).cache.opacity, parseFloat(defaultStyles.opacity as any), \"Defined start value #2 was calculated.\");\r\n\tassert.equal(Data($target2).cache.color, parseFloat(defaultStyles.colorGreen as any), \"Defined hooked start value was calculated.\");\r\n\r\n\t/* Properties that shouldn't cause start values to be unit-converted. */\r\n\tconst testPropertiesEndNoConvert = {paddingLeft: \"20px\", height: \"40px\", paddingRight: \"75%\"},\r\n\t\t$target3 = getTarget();\r\n\r\n\tapplyStartValues($target3, testStartValues);\r\n\tVelocity($target3, testPropertiesEndNoConvert);\r\n\tassert.equal(Data($target3).cache.paddingLeft, parseFloat(testStartValues.paddingLeft), \"Start value #1 wasn't unit converted.\");\r\n\tassert.equal(Data($target3).cache.height, parseFloat(testStartValues.height), \"Start value #2 wasn't unit converted.\");\r\n\t//\t\t\tassert.deepEqual(Data($target3).cache.paddingRight.startValue, [Math.floor((parentWidth * parseFloat(testStartValues.paddingRight)) / 100), 0],\r\n\t//\t\t\t \"Start value #3 was pattern matched.\");\r\n\r\n\t/* Properties that should cause start values to be unit-converted. */\r\n\tconst testPropertiesEndConvert = {paddingLeft: \"20%\", height: \"40%\", lineHeight: \"0.5em\", wordSpacing: \"2rem\", marginLeft: \"10vw\", marginTop: \"5vh\", marginBottom: \"100px\"},\r\n\t\tparentWidth = $qunitStage.clientWidth,\r\n\t\tparentHeight = $qunitStage.clientHeight,\r\n\t\tparentFontSize = Velocity($qunitStage, \"style\", \"fontSize\"),\r\n\t\tremSize = parseFloat(Velocity(document.body, \"style\", \"fontSize\") as any),\r\n\t\t$target4 = getTarget();\r\n\r\n\tapplyStartValues($target4, testStartValues);\r\n\tVelocity($target4, testPropertiesEndConvert);\r\n\r\n\t/* Long decimal results can be returned after unit conversion, and Velocity's code and the code here can differ in precision. So, we round floor values before comparison. */\r\n\t//\t\t\tassert.deepEqual(Data($target4).cache.paddingLeft.startValue, [parseFloat(testStartValues.paddingLeft), 0],\r\n\t//\t\t\t \"Horizontal property converted to %.\");\r\n\tassert.equal(parseInt(Data($target4).cache.height, 10), Math.floor((parseFloat(testStartValues.height) / parentHeight) * 100), \"Vertical property converted to %.\");\r\n\t//\t\t\tassert.equal(Data($target4).cache.lineHeight.startValue, Math.floor(parseFloat(testStartValues.lineHeight) / parseFloat(parentFontSize)),\r\n\t//\t\t\t \"Property converted to em.\");\r\n\t//\t\t\tassert.equal(Data($target4).cache.wordSpacing.startValue, Math.floor(parseFloat(testStartValues.wordSpacing) / parseFloat(remSize)),\r\n\t//\t\t\t \"Property converted to rem.\");\r\n\tassert.equal(parseInt(Data($target4).cache.marginBottom, 10), parseFloat(testStartValues.marginBottom) / 100 * parseFloat($target4.parentElement.offsetWidth as any),\r\n\t\t\"Property converted to px.\");\r\n\r\n\t//\t\t\tif (!(IE<=8) && !isAndroid) {\r\n\t//\t\t\t\tassert.equal(Data($target4).cache.marginLeft.startValue, Math.floor(parseFloat(testStartValues.marginLeft) / window.innerWidth * 100),\r\n\t//\t\t\t\t \"Horizontal property converted to vw.\");\r\n\t//\t\t\t\tassert.equal(Data($target4).cache.marginTop.startValue, Math.floor(parseFloat(testStartValues.marginTop) / window.innerHeight * 100),\r\n\t//\t\t\t\t \"Vertical property converted to vh.\");\r\n\t//\t\t\t}\r\n\r\n\t// TODO: Tests for auto-parameters as the units are no longer converted.\r\n\r\n\t/* jQuery TRBL deferring. */\r\n\tconst testPropertiesTRBL = {left: \"1000px\"},\r\n\t\t$TRBLContainer = document.createElement(\"div\");\r\n\r\n\t$TRBLContainer.setAttribute(\"id\", \"TRBLContainer\");\r\n\t$TRBLContainer.style.marginLeft = testPropertiesTRBL.left;\r\n\t$TRBLContainer.style.width = \"100px\";\r\n\t$TRBLContainer.style.height = \"100px\";\r\n\tdocument.body.appendChild($TRBLContainer);\r\n\r\n\tconst $target5 = getTarget();\r\n\r\n\t$target5.style.position = \"absolute\";\r\n\t$TRBLContainer.appendChild($target5);\r\n\tVelocity($target5, testPropertiesTRBL);\r\n\r\n\tassert.equal(parseInt(Data($target5).cache.left, 10),\r\n\t\tMath.round(parseFloat(testPropertiesTRBL.left) + parseFloat(Velocity(document.body, \"style\", \"marginLeft\") as any)),\r\n\t\t\"TRBL value was deferred to jQuery.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Unit Calculation\", (assert) => {\r\n\t// TODO: Add code and tests for operators - probably using calc() internally\r\n\t//\t/* Standard properties with operators. */\r\n\t//\tvar testIncrementWidth = \"5px\",\r\n\t//\t\t\ttestDecrementOpacity = 0.25,\r\n\t//\t\t\ttestMultiplyMarginBottom = 4,\r\n\t//\t\t\ttestDivideHeight = 2;\r\n\t//\r\n\t//\tvar $target2 = getTarget();\r\n\t//\tVelocity($target2, {width: \"+=\" + testIncrementWidth, opacity: \"-=\" + testDecrementOpacity, marginBottom: \"*=\" + testMultiplyMarginBottom, height: \"/=\" + testDivideHeight});\r\n\t//\tsetTimeout(function() {\r\n\t//\r\n\t//\t\tassert.equal(Data($target2).style.width.endValue, defaultStyles.width + parseFloat(testIncrementWidth), \"Incremented end value was calculated.\");\r\n\t//\t\tassert.equal(Data($target2).style.opacity.endValue, defaultStyles.opacity - testDecrementOpacity, \"Decremented end value was calculated.\");\r\n\t//\t\tassert.equal(Data($target2).style.marginBottom.endValue, defaultStyles.marginBottom * testMultiplyMarginBottom, \"Multiplied end value was calculated.\");\r\n\t//\t\tassert.equal(Data($target2).style.height.endValue, defaultStyles.height / testDivideHeight, \"Divided end value was calculated.\");\r\n\t//\r\n\t//\t\tdone();\r\n\t//\t}, asyncCheckDuration);\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {left: \"500px\"}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"500px\", \"Finished animated value with given pixels should be the same.\");\r\n\t\tVelocity($target, {left: \"0px\"}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Finished animated value with 0px should be the same.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\t//\tasync(assert, 1, async (done) => {\r\n\t//\t\tconst $target = getTarget();\r\n\t//\r\n\t//\t\tVelocity($target, {left: \"500px\"}, {duration: 10});\r\n\t//\t\tawait sleep(100);\r\n\t//\t\tVelocity($target, {left: \"0\"}, {duration: 10});\r\n\t//\t\tawait sleep(100);\r\n\t//\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Finished animated value without giving px, but only number as a string should be the same.\");\r\n\t//\r\n\t//\t\tdone();\r\n\t//\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {left: \"500px\"}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tVelocity($target, {left: 0}, {duration: 10});\r\n\t\tawait sleep(1000);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Finished animated value given as number 0 should be the same as 0px.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {left: 500}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"500px\", \"Finished animated value with given pixels should be the same.\");\r\n\t\tVelocity($target, {left: 0}, {duration: 10});\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"left\"), \"0px\", \"Omitted pixels (px) when given animation should run properly.\");\r\n\r\n\t\tdone();\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Begin\", (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $targetSet = [getTarget(), getTarget()];\r\n\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.deepEqual(elements, $targetSet, \"Elements passed into callback.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Complete\", (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $targetSet = [getTarget(), getTarget()];\r\n\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.deepEqual(elements, $targetSet, \"Elements passed into callback.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultOptions, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Delay\", (assert) => {\r\n\tconst testDelay = 250;\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst start = getNow();\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration: defaultOptions.duration,\r\n\t\t\tdelay: testDelay,\r\n\t\t\tbegin(elements, activeCall) {\r\n\t\t\t\tassert.close(getNow() - start, testDelay, 32, \"Delayed calls start after the correct delay.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst start = getNow();\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration: defaultOptions.duration,\r\n\t\t\tdelay: testDelay,\r\n\t\t})\r\n\t\t\t.velocity(defaultProperties, {\r\n\t\t\t\tduration: defaultOptions.duration,\r\n\t\t\t\tdelay: testDelay,\r\n\t\t\t\tbegin(elements, activeCall) {\r\n\t\t\t\t\tassert.close(getNow() - start, (testDelay * 2) + (defaultOptions.duration as number), 32, \"Queued delays start after the correct delay.\");\r\n\r\n\t\t\t\t\tdone();\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Easing\", (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tlet success = false;\r\n\r\n\t\ttry {\r\n\t\t\tsuccess = true;\r\n\t\t\tVelocity(getTarget(), defaultProperties, {easing: \"fake\"});\r\n\t\t} catch (e) {\r\n\t\t\tsuccess = false;\r\n\t\t}\r\n\t\tassert.ok(success, \"Fake easing string didn't throw error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tlet success = false;\r\n\r\n\t\ttry {\r\n\t\t\tsuccess = true;\r\n\t\t\tVelocity(getTarget(), defaultProperties, {easing: [\"a\" as any, 0.5, 0.5, 0.5]});\r\n\t\t\tVelocity(getTarget(), defaultProperties, {easing: [0.5, 0.5, 0.5]});\r\n\t\t} catch (e) {\r\n\t\t\tsuccess = false;\r\n\t\t}\r\n\t\tassert.ok(success, \"Invalid bezier curve didn't throw error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\t// TODO: Use a \"tween\" action?\r\n\t\t/* Ensure that a properly-formatted bezier curve array returns a bezier function. */\r\n\t\tconst easingBezierArray = [0.27, -0.65, 0.78, 0.19],\r\n\t\t\teasingBezierTestPercent = 0.25,\r\n\t\t\teasingBezierTestValue = -0.23;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\teasing: easingBezierArray,\r\n\t\t\tbegin(elements, animation) {\r\n\t\t\t\tassert.close(animation.options.easing(easingBezierTestPercent, 0, 1), easingBezierTestValue, 0.005, \"Array converted into bezier function.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\t/* Ensure that a properly-formatted spring RK4 array returns a bezier function. */\r\n\t\tconst easingSpringRK4Array = [250, 12],\r\n\t\t\teasingSpringRK4TestPercent = 0.25,\r\n\t\t\teasingSpringRK4TestValue = 0.928, // TODO: Check accuracy\r\n\t\t\teasingSpringRK4TestDuration = 992;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration: 150,\r\n\t\t\teasing: easingSpringRK4Array,\r\n\t\t\tbegin(elements, animation) {\r\n\t\t\t\tassert.close(animation.options.easing(easingSpringRK4TestPercent, 0, 1), easingSpringRK4TestValue, 10, \"Array with duration converted into springRK4 function.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\t// TODO: Get this working in Velocity - so it can be tested\r\n\t//\tasync(assert, 1, (done) => {\r\n\t//\tVelocity(getTarget(), defaultProperties, {\r\n\t//\t\teasing: easingSpringRK4Array,\r\n\t//\t\tbegin(elements, animation) {\r\n\t//\t\t\tassert.equal(animation.duration, easingSpringRK4TestDuration, \"Array without duration converted into springRK4 duration.\");\r\n\t//\t\t\tdone();\r\n\t//\t\t}\r\n\t//\t});\r\n\t//\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\t/* Ensure that a properly-formatted step easing array returns a step function. */\r\n\t\tconst easingStepArray = [4],\r\n\t\t\teasingStepTestPercent = 0.35,\r\n\t\t\teasingStepTestValue = 0.25;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\teasing: easingStepArray,\r\n\t\t\tbegin(elements, animation) {\r\n\t\t\t\tassert.close(animation.options.easing(easingStepTestPercent, 0, 1), easingStepTestValue, 0.05, \"Array converted into Step function.\");\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 3, (done) => {\r\n\t\tVelocity(getTarget(), {opacity: [0, \"during\", 1]}, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct begin value (easing:'during').\");\r\n\t\t\t},\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct progress value (easing:'during').\");\r\n\t\t\t}),\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct complete value (easing:'during').\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 3, (done) => {\r\n\t\tVelocity(getTarget(), {opacity: [0, \"at-start\", 1]}, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct begin value (easing:'at-start').\");\r\n\t\t\t},\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct progress value (easing:'at-start').\");\r\n\t\t\t}),\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct complete value (easing:'at-start').\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 3, (done) => {\r\n\t\tVelocity(getTarget(), {opacity: [0, \"at-end\", 1]}, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct begin value (easing:'at-end').\");\r\n\t\t\t},\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 1, \"Correct progress value (easing:'at-end').\");\r\n\t\t\t}),\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"opacity\"), 0, \"Correct complete value (easing:'at-end').\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"FPS Limit\", async (assert) => {\r\n\tlet count: number;\r\n\tconst $target = getTarget(),\r\n\t\tframeRates = [5, 15, 30, 60],\r\n\t\ttestFrame = (frameRate) => {\r\n\t\t\tlet counter = 0;\r\n\r\n\t\t\tVelocity.defaults.fpsLimit = frameRate;\r\n\t\t\t// Test if the frame rate is assigned succesfully.\r\n\t\t\tassert.equal(frameRate, Velocity.defaults.fpsLimit, \"Setting global fps limit to \" + frameRate);\r\n\r\n\t\t\treturn Velocity($target, defaultProperties,\r\n\t\t\t\t{\r\n\t\t\t\t\tduration: 1000,\r\n\t\t\t\t\tprogress() {\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t},\r\n\t\t\t\t})\r\n\t\t\t\t.then(() => counter);\r\n\t\t};\r\n\r\n\tassert.expect(frameRates.length * 2);\r\n\t// Test if the limit is working for 60, 30, 15 and 5 fps.\r\n\tfor (const frameRate of frameRates) {\r\n\t\tassert.ok((count = await testFrame(frameRate)) <= frameRate + 1, `...counted ${count} frames (\\xB11 frame)`);\r\n\t}\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Loop\", (assert) => {\r\n\tasyncTests(assert, 4, (done) => {\r\n\t\tconst testOptions = {loop: 2, delay: 100, duration: 100},\r\n\t\t\tstart = getNow();\r\n\t\tlet begin = 0,\r\n\t\t\tcomplete = 0,\r\n\t\t\tloop = 0,\r\n\t\t\tlastPercentComplete = 2;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties,\r\n\t\t\t{\r\n\t\t\t\tloop: testOptions.loop,\r\n\t\t\t\tdelay: testOptions.delay,\r\n\t\t\t\tduration: testOptions.duration,\r\n\t\t\t\tbegin() {\r\n\t\t\t\t\tbegin++;\r\n\t\t\t\t},\r\n\t\t\t\tprogress(elements, percentComplete) {\r\n\t\t\t\t\tif (lastPercentComplete > percentComplete) {\r\n\t\t\t\t\t\tloop++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastPercentComplete = percentComplete;\r\n\t\t\t\t},\r\n\t\t\t\tcomplete() {\r\n\t\t\t\t\tcomplete++;\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tassert.equal(begin, 1, \"Begin callback only called once.\");\r\n\t\t\t\tassert.equal(loop, testOptions.loop * 2 - 1, \"Animation looped correct number of times (once each direction per loop).\");\r\n\t\t\t\tassert.close(getNow() - start, (testOptions.delay + testOptions.duration) * loop, 32, \"Looping with 'delay' has correct duration.\");\r\n\t\t\t\tassert.equal(complete, 1, \"Complete callback only called once.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Progress\", (assert) => {\r\n\tasyncTests(assert, 4, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tduration: asyncCheckDuration,\r\n\t\t\tprogress: once(function(elements, percentComplete, msRemaining) { // tslint:disable-line:only-arrow-functions\r\n\t\t\t\tassert.deepEqual(elements, [$target], \"Elements passed into progress.\");\r\n\t\t\t\tassert.deepEqual(this, [$target], \"Elements passed into progress as this.\"); // tslint:disable-line:no-invalid-this\r\n\t\t\t\tassert.equal(percentComplete >= 0 && percentComplete <= 1, true, \"'percentComplete' passed into progress.\");\r\n\t\t\t\tassert.equal(msRemaining > asyncCheckDuration - 50, true, \"'msRemaining' passed into progress.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t}),\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Queue\", (assert) => {\r\n\tconst done = assert.async(4),\r\n\t\ttestQueue = \"custom\",\r\n\t\t$target = getTarget(),\r\n\t\tignore = $target.velocity(\"style\", \"display\"), // Force data creation\r\n\t\tdata = Data($target);\r\n\tlet anim1: boolean,\r\n\t\tanim2: boolean,\r\n\t\tanim3: boolean;\r\n\r\n\tassert.expect(7);\r\n\r\n\tassert.ok(data.queueList[testQueue] === undefined, \"Custom queue is empty.\"); // Shouldn't exist\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tqueue: testQueue,\r\n\t\tbegin() {\r\n\t\t\tanim1 = true;\r\n\t\t},\r\n\t\tcomplete() {\r\n\t\t\tanim1 = false;\r\n\t\t\tassert.ok(!anim2, \"Queued animation isn't started early.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t});\r\n\tassert.ok(data.queueList[testQueue] !== undefined, \"Custom queue was created.\"); // Should exist, but be \"null\"\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tqueue: testQueue,\r\n\t\tbegin() {\r\n\t\t\tanim2 = true;\r\n\t\t\tassert.ok(anim1 === false, \"Queued animation starts after first.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete() {\r\n\t\t\tanim2 = false;\r\n\t\t},\r\n\t});\r\n\tassert.ok(data.queueList[testQueue], \"Custom queue grows.\"); // Should exist and point at the next animation\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tbegin() {\r\n\t\t\tanim3 = true;\r\n\t\t\tassert.ok(anim1 === true, \"Different queue animation starts in parallel.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete() {\r\n\t\t\tanim3 = false;\r\n\t\t},\r\n\t});\r\n\r\n\t$target.velocity(defaultProperties, {\r\n\t\tqueue: false,\r\n\t\tbegin() {\r\n\t\t\tassert.ok(anim1 === true, \"Queue:false animation starts in parallel.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Repeat\", (assert) => {\r\n\tasyncTests(assert, 4, (done) => {\r\n\t\tconst testOptions = {repeat: 2, delay: 100, duration: 100},\r\n\t\t\tstart = Date.now();\r\n\t\tlet begin = 0,\r\n\t\t\tcomplete = 0,\r\n\t\t\trepeat = 0;\r\n\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\trepeat: testOptions.repeat,\r\n\t\t\tdelay: testOptions.delay,\r\n\t\t\tduration: testOptions.duration,\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin++;\r\n\t\t\t},\r\n\t\t\tprogress(elements, percentComplete) {\r\n\t\t\t\tif (percentComplete === 1) {\r\n\t\t\t\t\trepeat++;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete++;\r\n\t\t\t\tassert.equal(begin, 1, \"Begin callback only called once.\");\r\n\t\t\t\tassert.equal(repeat, testOptions.repeat + 1, \"Animation repeated correct number of times (original plus repeats).\");\r\n\t\t\t\tassert.close(Date.now() - start, (testOptions.delay + testOptions.duration) * (testOptions.repeat + 1), (testOptions.repeat + 1) * 16 + 32,\r\n\t\t\t\t\t\"Repeat with 'delay' has correct duration.\");\r\n\t\t\t\tassert.equal(complete, 1, \"Complete callback only called once.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityExtended} from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\ninterface ExtendedVelocityExtended extends VelocityExtended {\r\n\t__count?: number;\r\n\t__start?: number;\r\n}\r\n\r\nQUnit.test(\"Speed\", (assert) => {\r\n\tconst delay = 200,\r\n\t\tduration = 400,\r\n\t\tstartDelay = getNow();\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity.defaults.speed = 3;\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tspeed: 5,\r\n\t\t\tbegin(elements) {\r\n\t\t\t\tassert.equal(elements.velocity.animations[0].options.speed, 5, \"Speed on options overrides default.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = getNow();\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = duration / 3;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Velocity.defaults.speed change is respected. (\\xD73, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tspeed: 2,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = getNow();\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = duration / 2;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Double speed animation lasts half as long. (\\xD72, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tdelay,\r\n\t\t\tspeed: 2,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = startDelay;\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = (duration + delay) / 2;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Delayed animation includes speed for delay. (\\xD72, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tdelay: -delay,\r\n\t\t\tspeed: 2,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = startDelay;\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = (duration - delay) / 2;\r\n\r\n\t\t\t\tassert.close(actual, expected, 32, `Negative delay animation includes speed for delay. (\\xD72, ${Math.floor(actual - expected)}ms \\xB132ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tspeed: 0.5,\r\n\t\t\tbegin(elements: ExtendedVelocityExtended) {\r\n\t\t\t\telements.__start = getNow();\r\n\t\t\t},\r\n\t\t\tcomplete(elements: ExtendedVelocityExtended) {\r\n\t\t\t\tconst actual = getNow() - elements.__start,\r\n\t\t\t\t\texpected = duration * 2;\r\n\r\n\t\t\t\t// TODO: Really not happy with the allowed range - it sits around 40ms, but should be closer to 16ms\r\n\t\t\t\tassert.close(actual, expected, 64, `Half speed animation lasts twice as long. (\\xD7\\xBD, ${Math.floor(actual - expected)}ms \\xB164ms)`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), defaultProperties, {\r\n\t\t\tduration,\r\n\t\t\tspeed: 0,\r\n\t\t\tprogress(elements: ExtendedVelocityExtended, percentComplete) {\r\n\t\t\t\tif (!elements.__count) {\r\n\t\t\t\t\telements.__start = percentComplete;\r\n\t\t\t\t\telements.__count = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassert.equal(elements.__start, percentComplete, \"Frozen (speed:0) animation doesn't progress.\");\r\n\t\t\t\t\telements\r\n\t\t\t\t\t\t.velocity(\"option\", \"speed\", 1) // Just in case \"stop\" is broken\r\n\t\t\t\t\t\t.velocity(\"stop\");\r\n\r\n\t\t\t\t\tdone();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Sync\", (assert) => {\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\t$targetSet = [getTarget(), $target, getTarget()];\r\n\t\tlet complete = false;\r\n\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tduration: 300,\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tsync: false,\r\n\t\t\tduration: 250,\r\n\t\t});\r\n\t\tawait sleep(275);\r\n\t\tassert.notOk(complete, \"Sync 'false' animations don't wait for completion.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\t$targetSet = [getTarget(), $target, getTarget()];\r\n\t\tlet complete = false;\r\n\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tduration: 300,\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($targetSet, defaultProperties, {\r\n\t\t\tsync: true,\r\n\t\t\tduration: 250,\r\n\t\t\tbegin() {\r\n\t\t\t\tassert.ok(complete, \"Sync 'true' animations wait for completion.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultOptions, defaultProperties, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Finish\", async (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), \"finish\");\r\n\t\tassert.ok(true, \"Calling on an element that isn't animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, defaultProperties, defaultOptions);\r\n\t\tVelocity($target, {top: 0}, defaultOptions);\r\n\t\tVelocity($target, {width: 0}, defaultOptions);\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.ok(true, \"Calling on an element that is animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet complete1 = false,\r\n\t\t\tcomplete2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test1\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete1 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test2\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"finish\", \"test1\");\r\n\t\tawait sleep(defaultOptions.duration as number / 2);\r\n\t\tassert.ok(complete1, \"Finish animation with correct queue.\");\r\n\t\tassert.notOk(complete2, \"Don't finish animation with wrong queue.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin = false,\r\n\t\t\tcomplete = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin = true;\r\n\t\t\t},\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tawait sleep(500);\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.ok(begin, \"Finish calls 'begin()' callback without delay.\");\r\n\t\tassert.ok(complete, \"Finish calls 'complete()' callback without delay.\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Finish animation with correct value.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin = false,\r\n\t\t\tcomplete = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tdelay: 1000,\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin = true;\r\n\t\t\t},\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tawait sleep(500);\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.ok(begin, \"Finish calls 'begin()' callback with delay.\");\r\n\t\tassert.ok(complete, \"Finish calls 'complete()' callback with delay.\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Finish animation with correct value before delay ends.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0})\r\n\t\t\t.velocity({opacity: 1})\r\n\t\t\t.velocity({opacity: 0.25})\r\n\t\t\t.velocity({opacity: 0.75})\r\n\t\t\t.velocity({opacity: 0.5});\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Finish once starts the second animation.\");\r\n\t\tVelocity($target, \"finish\");\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Finish twice starts the third animation.\");\r\n\t\tVelocity($target, \"finish\", true);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0.5\", \"Finish 'true' finishes all animations.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Pause + Resume\", async (assert) => {\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, \"pause\");\r\n\t\tassert.ok(true, \"Calling \\\"pause\\\" on an element that isn't animating doesn't cause an error.\");\r\n\t\tVelocity($target, \"resume\");\r\n\t\tassert.ok(true, \"Calling \\\"resume\\\" on an element that isn't animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 4, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet progress = false;\r\n\r\n\t\tVelocity($target, {opacity: 0}, {\r\n\t\t\tduration: 250,\r\n\t\t\tprogress() {\r\n\t\t\t\tprogress = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"pause\");\r\n\t\tawait sleep(50);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Property value unchanged after pause.\");\r\n\t\tassert.notOk(progress, \"Progress callback not run during pause.\");\r\n\t\tVelocity($target, \"resume\");\r\n\t\tawait sleep(300);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Tween completed after pause/resume.\");\r\n\t\tassert.ok(progress, \"Progress callback run after pause.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 3, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0}, {duration: 250, delay: 250});\r\n\t\tVelocity($target, \"pause\");\r\n\t\tawait sleep(500);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Delayed property value unchanged after pause.\");\r\n\t\tVelocity($target, \"resume\");\r\n\t\tawait sleep(100);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Delayed tween did not start early after pause.\");\r\n\t\tawait sleep(500);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"0\", \"Delayed tween completed after pause/resume.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0}, {queue: \"test\", duration: 250});\r\n\t\tVelocity(\"pause\", \"test\");\r\n\t\tawait sleep(300);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Pause 'queue' works globally.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, {opacity: 0})\r\n\t\t\t.velocity(\"pause\");\r\n\t\tawait sleep(300);\r\n\t\tassert.equal(getPropertyValue($target, \"opacity\"), \"1\", \"Chained pause only pauses chained tweens.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\t// TODO: Better global tests, queue: false, named queues\r\n\r\n\t//\t/* Ensure proper behavior with queue:false */\r\n\t//\tvar $target4 = getTarget();\r\n\t//\tVelocity($target4, {opacity: 0}, {duration: 200});\r\n\t//\r\n\t//\tvar isResumed = false;\r\n\t//\r\n\t//\tawait sleep(100);\r\n\t//\tVelocity($target4, \"pause\");\r\n\t//\tVelocity($target4, {left: -20}, {\r\n\t//\t\tduration: 100,\r\n\t//\t\teasing: \"linear\",\r\n\t//\t\tqueue: false,\r\n\t//\t\tbegin: function(elements) {\r\n\t//\t\t\tassert.ok(true, \"Animation with {queue:false} will run regardless of previously paused animations.\");\r\n\t//\t\t}\r\n\t//\t});\r\n\t//\r\n\t//\tVelocity($target4, {top: 20}, {\r\n\t//\t\tduration: 100,\r\n\t//\t\teasing: \"linear\",\r\n\t//\t\tbegin: function(elements) {\r\n\t//\t\t\tassert.ok(isResumed, \"Queued animation began after previously paused animation completed\");\r\n\t//\t\t}\r\n\t//\t});\r\n\t//\r\n\t//\tawait sleep(100);\r\n\t//\r\n\t//\tisResumed = true;\r\n\t//\tVelocity($target4, \"resume\");\r\n\t//\tawait sleep(100);\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Reverse\", (assert) => {\r\n\tconst $target = getTarget(),\r\n\t\topacity = $target.velocity(\"style\", \"opacity\"),\r\n\t\t// Browsers don't always suffix, but Velocity does.\r\n\t\twidth = $target.velocity(\"style\", \"width\") === \"0\" ? \"0px\" : $target.velocity(\"style\", \"width\");\r\n\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tVelocity($target, defaultProperties, {\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"opacity\"), defaultProperties.opacity, `Initial property #1 set correctly. (${defaultProperties.opacity})`);\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"width\"), defaultProperties.width, `Initial property #2 set correctly. (${defaultProperties.width})`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tVelocity($target, \"reverse\", {\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"opacity\"), opacity, `Reversed property #1 set correctly. (${opacity})`);\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"width\"), width, `Reversed property #2 set correctly. (${width})`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tasyncTests(assert, 2, (done) => {\r\n\t\tVelocity($target, \"reverse\", {\r\n\t\t\tcomplete(elements) {\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"opacity\"), defaultProperties.opacity, `Chained reversed property #1 set correctly. (${defaultProperties.opacity})`);\r\n\t\t\t\tassert.equal(elements[0].velocity(\"style\", \"width\"), defaultProperties.width, `Chained reversed property #2 set correctly. (${defaultProperties.width})`);\r\n\r\n\t\t\t\tdone();\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\n/* Window scrolling. */\r\nQUnit.skip(\"Scroll (Window)\", (assert) => {\r\n\t//\tvar done = assert.async(4),\r\n\t//\t\t$details = $(\"#details\"),\r\n\t//\t\t$scrollTarget1 = $(\"
Scroll target #1. Should stop 50 pixels above this point.
\"),\r\n\t//\t\t$scrollTarget2 = $(\"
Scroll target #2. Should stop 50 pixels before this point.
\"),\r\n\t//\t\tscrollOffset = -50;\r\n\t//\r\n\t//\t$scrollTarget1\r\n\t//\t\t.css({position: \"relative\", top: 3000, height: 100, paddingBottom: 10000})\r\n\t//\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t$scrollTarget2\r\n\t//\t\t.css({position: \"absolute\", top: 100, left: 3000, width: 100, paddingRight: 15000})\r\n\t//\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t$scrollTarget1\r\n\t//\t\t.velocity(\"scroll\", {\r\n\t//\t\t\tduration: 500, offset: scrollOffset, complete: function() {\r\n\t//\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyTop]\r\n\t//\t\t\t\t - ($scrollTarget1.offset().top + scrollOffset)) <= 100, true, \"Page scrolled top with a scroll offset.\");\r\n\t//\r\n\t//\t\t\t\tdone();\r\n\t//\t\t\t}\r\n\t//\t\t})\r\n\t//\t\t.velocity({opacity: 0.5}, function() {\r\n\t//\t\t\t$details\r\n\t//\t\t\t\t.velocity({opacity: 0.5}, 500)\r\n\t//\t\t\t\t.velocity(\"scroll\", 500)\r\n\t//\t\t\t\t.velocity({opacity: 1}, 500, function() {\r\n\t//\t\t\t\t\t//alert(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyTop] + \" \" + ($details.offset().top + scrollOffset))\r\n\t//\t\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyTop]\r\n\t//\t\t\t\t\t - ($details.offset().top + scrollOffset)) <= 100, true, \"Page scroll top was chained.\");\r\n\t//\r\n\t//\t\t\t\t\tdone();\r\n\t//\r\n\t//\t\t\t\t\t//$scrollTarget1.remove();\r\n\t//\r\n\t//\t\t\t\t\t$scrollTarget2\r\n\t//\t\t\t\t\t\t.velocity(\"scroll\", {\r\n\t//\t\t\t\t\t\t\tduration: 500, axis: \"x\", offset: scrollOffset, complete: function() {\r\n\t//\t\t\t\t\t\t\t\t/* Phones can reposition the browser's scroll position by a 10 pixels or so, so we just check for a value that's within that range. */\r\n\t//\t\t\t\t\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyLeft]\r\n\t//\t\t\t\t\t\t\t\t - ($scrollTarget2.offset().left + scrollOffset)) <= 100, true, \"Page scrolled left with a scroll offset.\");\r\n\t//\r\n\t//\t\t\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t\t\t}\r\n\t//\t\t\t\t\t\t})\r\n\t//\t\t\t\t\t\t.velocity({opacity: 0.5}, function() {\r\n\t//\t\t\t\t\t\t\t$details\r\n\t//\t\t\t\t\t\t\t\t.velocity({opacity: 0.5}, 500)\r\n\t//\t\t\t\t\t\t\t\t.velocity(\"scroll\", {duration: 500, axis: \"x\"})\r\n\t//\t\t\t\t\t\t\t\t.velocity({opacity: 1}, 500, function() {\r\n\t//\t\t\t\t\t\t\t\t\tassert.equal(Math.abs(Velocity.State.scrollAnchor[Velocity.State.scrollPropertyLeft]\r\n\t//\t\t\t\t\t\t\t\t\t - ($details.offset().left + scrollOffset)) <= 100, true, \"Page scroll left was chained.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bbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\tStop #2\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t
\\\r\n\t//\t\t\t\t\");\r\n\t//\r\n\t//\tassert.expect(2);\r\n\t//\t$scrollTarget1\r\n\t//\t\t.css({position: \"absolute\", backgroundColor: \"white\", top: 100, left: \"50%\", width: 500, height: 100, overflowY: \"scroll\"})\r\n\t//\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t/* Test with a jQuery object container. */\r\n\t//\t$(\"#scrollerChild1\").velocity(\"scroll\", {\r\n\t//\t\tcontainer: $(\"#scroller\"), duration: 750, complete: function() {\r\n\t//\t\t\t/* Test with a raw DOM element container. */\r\n\t//\t\t\t$(\"#scrollerChild2\").velocity(\"scroll\", {\r\n\t//\t\t\t\tcontainer: $(\"#scroller\")[0], duration: 750, complete: function() {\r\n\t//\t\t\t\t\t/* This test is purely visual. */\r\n\t//\t\t\t\t\tassert.ok(true);\r\n\t//\r\n\t//\t\t\t\t\t$scrollTarget1.remove();\r\n\t//\r\n\t//\t\t\t\t\tvar $scrollTarget2 = $(\"\\\r\n\t//\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tStop #1\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tcccccccccccccccccccccccccccccccccccccccccccccccccccccccc\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tStop #2\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\tdddddddddddddddddddddddddddddddddddddddddddddddddddddddd\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t\teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\\\r\n\t//\t\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\t
\\\r\n\t//\t\t\t\t\t\t\t\t\");\r\n\t//\r\n\t//\t\t\t\t\t$scrollTarget2\r\n\t//\t\t\t\t\t\t.css({position: \"absolute\", backgroundColor: \"white\", top: 100, left: \"50%\", width: 100, height: 500, overflowX: \"scroll\"})\r\n\t//\t\t\t\t\t\t.appendTo($(\"body\"));\r\n\t//\r\n\t//\t\t\t\t\t/* Test with a jQuery object container. */\r\n\t//\t\t\t\t\t$(\"#scrollerChild2\").velocity(\"scroll\", {\r\n\t//\t\t\t\t\t\taxis: \"x\", container: $(\"#scroller\"), duration: 750, complete: function() {\r\n\t//\t\t\t\t\t\t\t/* Test with a raw DOM element container. */\r\n\t//\t\t\t\t\t\t\t$(\"#scrollerChild1\").velocity(\"scroll\", {\r\n\t//\t\t\t\t\t\t\t\taxis: \"x\", container: $(\"#scroller\")[0], duration: 750, complete: function() {\r\n\t//\t\t\t\t\t\t\t\t\t/* This test is purely visual. */\r\n\t//\t\t\t\t\t\t\t\t\tassert.ok(true);\r\n\t//\r\n\t//\t\t\t\t\t\t\t\t\t$scrollTarget2.remove();\r\n\t//\r\n\t//\t\t\t\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t\t\t\t}\r\n\t//\t\t\t\t\t\t\t});\r\n\t//\t\t\t\t\t\t}\r\n\t//\t\t\t\t\t});\r\n\t//\r\n\t//\t\t\t\t\tdone();\r\n\t//\t\t\t\t}\r\n\t//\t\t\t});\r\n\t//\t\t}\r\n\t//\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncTests, defaultOptions, defaultProperties, getPropertyValue, getTarget, sleep} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Stop\", async (assert) => {\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tVelocity(getTarget(), \"stop\");\r\n\t\tassert.ok(true, \"Calling on an element that isn't animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, (done) => {\r\n\t\tconst $target = getTarget();\r\n\r\n\t\tVelocity($target, defaultProperties, defaultOptions);\r\n\t\tVelocity($target, {top: 0}, defaultOptions);\r\n\t\tVelocity($target, {width: 0}, defaultOptions);\r\n\t\tVelocity($target, \"stop\");\r\n\t\tassert.ok(true, \"Calling on an element that is animating doesn't cause an error.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\tstartOpacity = getPropertyValue($target, \"opacity\");\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, defaultOptions);\r\n\t\tawait sleep(defaultOptions.duration as number / 2);\r\n\t\tVelocity($target, \"stop\");\r\n\t\tassert.close(parseFloat(getPropertyValue($target, \"opacity\")), parseFloat(startOpacity) / 2, 0.1, \"Animation runs until stopped.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tdelay: 1000,\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tawait sleep(500);\r\n\t\tVelocity($target, \"stop\");\r\n\t\tassert.notOk(begin, \"Stop animation before delay ends.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet complete1 = false,\r\n\t\t\tcomplete2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test1\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete1 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tqueue: \"test2\",\r\n\t\t\tcomplete() {\r\n\t\t\t\tcomplete2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"stop\", \"test1\");\r\n\t\tawait sleep(defaultOptions.duration as number * 2);\r\n\t\tassert.ok(complete2, \"Stop animation with correct queue.\");\r\n\t\tassert.notOk(complete1, \"Don't stop animation with wrong queue.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 1, async (done) => {\r\n\t\tconst $target = getTarget();\r\n\t\tlet begin1 = false,\r\n\t\t\tbegin2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin1 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, {width: \"500px\"}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tVelocity($target, \"stop\", true);\r\n\t\tawait sleep(defaultOptions.duration as number * 2);\r\n\t\tassert.notOk(begin1 || begin2, \"Stop 'true' stops all animations.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tasyncTests(assert, 2, async (done) => {\r\n\t\tconst $target = getTarget(),\r\n\t\t\tanim = Velocity($target, {opacity: [0, 1]}, {\r\n\t\t\t\tqueue: \"test\",\r\n\t\t\t\tbegin() {\r\n\t\t\t\t\tbegin1 = true;\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\tlet begin1 = false,\r\n\t\t\tbegin2 = false;\r\n\r\n\t\tVelocity($target, {opacity: [0, 1]}, {\r\n\t\t\tbegin() {\r\n\t\t\t\tbegin2 = true;\r\n\t\t\t},\r\n\t\t});\r\n\t\tanim.velocity(\"stop\");\r\n\t\tawait sleep(defaultOptions.duration as number * 2);\r\n\t\tassert.notOk(begin1, \"Stop without arguments on a chain stops chain animations.\");\r\n\t\tassert.ok(begin2, \"Stop without arguments on a chain doesn't stop other animations.\");\r\n\r\n\t\tdone();\r\n\t});\r\n\r\n\tassert.expect(asyncTests());\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Tween\", (assert) => {\r\n\tconst $target1 = getTarget(),\r\n\t\tstartOpacity = $target1.style.opacity;\r\n\r\n\tassert.expect(11);\r\n\r\n\tassert.raises(() => (Velocity as any)(\"tween\", \"invalid\"), \"Invalid percentComplete throws an error.\");\r\n\tassert.raises(() => (Velocity as any)([$target1, $target1], \"tween\", \"invalid\"), \"Passing more than one target throws an error.\");\r\n\tassert.raises(() => (Velocity as any)(\"tween\", 0, [\"invalid\"]), \"Invalid propertyMap throws an error.\");\r\n\tassert.raises(() => (Velocity as any)(\"tween\", 0, \"invalid\", 1), \"Property without an element must be forcefed or throw an error.\");\r\n\r\n\tassert.equal($target1.velocity(\"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"0.5\", \"Calling on an chain returns the correct value.\");\r\n\tassert.equal(Velocity($target1, \"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"0.5\", \"Calling with an element returns the correct value.\");\r\n\tassert.equal(Velocity(\"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"0.5\", \"Calling without an element returns the correct value.\");\r\n\tassert.equal($target1.style.opacity, startOpacity, \"Ensure that the element is not altered.\");\r\n\r\n\tassert.equal(typeof Velocity($target1, \"tween\", 0.5, \"opacity\", [1, 0], \"linear\"), \"string\", \"Calling a single property returns a value.\");\r\n\tassert.equal(typeof Velocity($target1, \"tween\", 0.5, {opacity: [1, 0]}, \"linear\"), \"object\", \"Calling a propertiesMap returns an object.\");\r\n\tassert.deepEqual($target1.velocity(\"tween\", 0.5, {opacity: [1, 0]}, \"linear\"), Velocity($target1, \"tween\", 0.5, {opacity: [1, 0]}, \"linear\"),\r\n\t\t\"Calling directly returns the same as a chain.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nQUnit.module(\"Feature\");\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"'velocity-animating' Classname\", (assert) => {\r\n\tconst done = assert.async(1);\r\n\r\n\tVelocity(getTarget(), defaultProperties, {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.equal(/velocity-animating/.test(elements[0].className), true, \"Class added.\");\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.equal(/velocity-animating/.test(elements[0].className), false, \"Class removed.\");\r\n\t\t},\r\n\t})\r\n\t\t.then(done);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Colors (Shorthands)\", (assert) => {\r\n\tconst $target = getTarget();\r\n\r\n\tVelocity($target, {borderColor: \"#7871c2\", color: [\"#297dad\", \"spring\", \"#5ead29\"]});\r\n\r\n\t//\tassert.equal(Data($target).style.borderColorRed.endValue, 120, \"Hex #1a component.\");\r\n\t//\tassert.equal(Data($target).style.borderColorGreen.endValue, 113, \"Hex #1b component.\");\r\n\t//\tassert.equal(Data($target).style.borderColorBlue.endValue, 194, \"Hex #1c component.\");\r\n\t//\tassert.equal(Data($target).style.colorRed.easing, \"spring\", \"Per-property easing.\");\r\n\t//\tassert.equal(Data($target).style.colorRed.startValue, 94, \"Forcefed hex #2a component.\");\r\n\t//\tassert.equal(Data($target).style.colorGreen.startValue, 173, \"Forcefed hex #2b component.\");\r\n\t//\tassert.equal(Data($target).style.colorBlue.startValue, 41, \"Forcefed hex #2c component.\");\r\n\t//\tassert.equal(Data($target).style.colorRed.endValue, 41, \"Hex #3a component.\");\r\n\t//\tassert.equal(Data($target).style.colorGreen.endValue, 125, \"Hex #3b component.\");\r\n\t//\tassert.equal(Data($target).style.colorBlue.endValue, 173, \"Hex #3c component.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, defaultProperties, defaultStyles, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Forcefeeding\", (assert) => {\r\n\t/* Note: Start values are always converted into pixels. W test the conversion ratio we already know to avoid additional work. */\r\n\tconst testStartWidth = \"1rem\",\r\n\t\ttestStartWidthToPx = \"16px\",\r\n\t\ttestStartHeight = \"10px\",\r\n\t\t$target = getTarget();\r\n\r\n\tVelocity($target, {\r\n\t\twidth: [100, \"linear\", testStartWidth],\r\n\t\theight: [100, testStartHeight],\r\n\t\topacity: [defaultProperties.opacity as any, \"easeInQuad\"],\r\n\t});\r\n\r\n\tassert.equal(Data($target).cache.width, parseFloat(testStartWidthToPx), \"Forcefed value #1 passed to tween.\");\r\n\tassert.equal(Data($target).cache.height, parseFloat(testStartHeight), \"Forcefed value #2 passed to tween.\");\r\n\tassert.equal(Data($target).cache.opacity, defaultStyles.opacity, \"Easing was misinterpreted as forcefed value.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {defaultOptions, defaultProperties, getNow, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Promises\", (assert) => {\r\n\tconst done = assert.async(10),\r\n\t\tstart = getNow();\r\n\tlet result: VelocityResult;\r\n\r\n\tassert.expect(10);\r\n\r\n\t/**********************\r\n\t Invalid Arguments\r\n\t **********************/\r\n\r\n\t((Velocity as any)() as Promise)\r\n\t\t.then(() => {\r\n\t\t\tassert.notOk(true, \"Calling with no arguments should reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(true, \"Calling with no arguments should reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tVelocity(getTarget() as any)\r\n\t\t.then(() => {\r\n\t\t\tassert.notOk(true, \"Calling with no properties should reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(true, \"Calling with no properties should reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tVelocity(getTarget(), {})\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Calling with empty properties should not reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.notOk(true, \"Calling with empty properties should not reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tVelocity(getTarget(), {}, defaultOptions.duration)\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Calling with empty properties + duration should not reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.notOk(true, \"Calling with empty properties + duration should not reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\t/* Invalid arguments: Ensure an error isn't thrown. */\r\n\tVelocity(getTarget(), {} as any, \"fakeArg1\", \"fakeArg2\")\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Calling with invalid arguments should reject a Promise.\");\r\n\t\t}, () => {\r\n\t\t\tassert.notOk(true, \"Calling with invalid arguments should reject a Promise.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tresult = Velocity(getTarget(), defaultProperties, defaultOptions);\r\n\tresult\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.length, 1, \"Calling with a single element fulfills with a single element array.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Calling with a single element fulfills with a single element array.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\tresult.velocity(defaultProperties)\r\n\t\t.then((elements) => {\r\n\t\t\tassert.ok(getNow() - start > 2 * (defaultOptions.duration as number), \"Queued call fulfilled after correct delay.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Queued call fulfilled after correct delay.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tresult = Velocity([getTarget(), getTarget()], defaultProperties, defaultOptions);\r\n\tresult\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.length, 2, \"Calling with multiple elements fulfills with a multiple element array.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Calling with multiple elements fulfills with a multiple element array.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\r\n\tconst anim = Velocity(getTarget(), defaultProperties, defaultOptions);\r\n\r\n\tanim\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(getNow() - start < (defaultOptions.duration as number), \"Stop call fulfilled after correct delay.\");\r\n\t\t}, () => {\r\n\t\t\tassert.ok(false, \"Stop call fulfilled after correct delay.\");\r\n\t\t})\r\n\t\t.then(done);\r\n\tanim.velocity(\"stop\");\r\n\r\n\tPromise\r\n\t\t.all([\r\n\t\t\tVelocity(getTarget(), defaultProperties, defaultOptions).promise,\r\n\t\t\tVelocity(getTarget(), defaultProperties, defaultOptions).promise,\r\n\t\t])\r\n\t\t.then(() => {\r\n\t\t\tassert.ok(true, \"Promise.all fulfilled when all animations have finished.\");\r\n\t\t})\r\n\t\t.then(done);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, asyncTests, defaultProperties, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Sequences\", (assert) => {\r\n\t//\tvar done = assert.async(2),\r\n\t//\t\t$target1 = getTarget(),\r\n\t//\t\t$target2 = getTarget(),\r\n\t//\t\tredirectOptions = {duration: 1500};\r\n\t//\r\n\t//\t((window as any).jQuery || (window as any).Zepto || window).Velocity.Redirects.test = function(element, options, elementIndex, elementsLength) {\r\n\t//\t\tif (elementIndex === 0) {\r\n\t//\t\t\tassert.deepEqual(element, $target1, \"Element passed through #1.\");\r\n\t//\t\t\tassert.deepEqual(options, redirectOptions, \"Options object passed through #1.\");\r\n\t//\t\t\tassert.equal(elementIndex, 0, \"Element index passed through #1.\");\r\n\t//\t\t\tassert.equal(elementsLength, 2, \"Elements length passed through #1.\");\r\n\t//\r\n\t//\t\t\tdone();\r\n\t//\t\t} else if (elementIndex === 1) {\r\n\t//\t\t\tassert.deepEqual(element, $target2, \"Element passed through #2.\");\r\n\t//\t\t\tassert.deepEqual(options, redirectOptions, \"Options object passed through #2.\");\r\n\t//\t\t\tassert.equal(elementIndex, 1, \"Element index passed through #2.\");\r\n\t//\t\t\tassert.equal(elementsLength, 2, \"Elements length passed through #2.\");\r\n\t//\r\n\t//\t\t\tdone();\r\n\t//\t\t}\r\n\t//\t};\r\n\t//\r\n\t//\tVelocity([$target1, $target2], \"test\", redirectOptions);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {Data, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.todo(\"Value Functions\", (assert) => {\r\n\tconst testWidth = 10,\r\n\t\t$target1 = getTarget(),\r\n\t\t$target2 = getTarget();\r\n\r\n\tVelocity([$target1, $target2], {\r\n\t\twidth(i, total) {\r\n\t\t\treturn (i + 1) / total * testWidth;\r\n\t\t},\r\n\t});\r\n\r\n\tassert.equal(Data($target1).cache.width, parseFloat(testWidth as any) / 2, \"Function value #1 passed to tween.\");\r\n\tassert.equal(Data($target2).cache.width, parseFloat(testWidth as any), \"Function value #2 passed to tween.\");\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Packaged Effect: slideUp/Down\", (assert) => {\r\n\tconst done = assert.async(4),\r\n\t\t$target1 = getTarget(),\r\n\t\t$target2 = getTarget(),\r\n\t\tinitialStyles = {\r\n\t\t\tdisplay: \"none\",\r\n\t\t\tpaddingTop: \"123px\",\r\n\t\t};\r\n\r\n\t$target1.style.display = initialStyles.display;\r\n\t$target1.style.paddingTop = initialStyles.paddingTop;\r\n\r\n\tVelocity($target1, \"slideDown\", {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target1], \"slideDown: Begin callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target1], \"slideDown: Complete callback returned.\");\r\n\t\t\t//\t\t\tassert.equal(getPropertyValue($target1, \"display\"), Values.getDisplayType($target1), \"slideDown: display set to default.\");\r\n\t\t\tassert.notEqual(getPropertyValue($target1, \"height\"), 0, \"slideDown: height set.\");\r\n\t\t\tassert.equal(getPropertyValue($target1, \"paddingTop\"), initialStyles.paddingTop, \"slideDown: paddingTop set.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\t//\t}).then(function(elements) {\r\n\t\t//\t\tassert.deepEqual(elements, [$target1], \"slideDown: Promise fulfilled.\");\r\n\t\t//\r\n\t\t//\t\tdone();\r\n\t});\r\n\r\n\tVelocity($target2, \"slideUp\", {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target2], \"slideUp: Begin callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.deepEqual(elements, [$target2], \"slideUp: Complete callback returned.\");\r\n\t\t\tassert.equal(getPropertyValue($target2, \"display\"), 0, \"slideUp: display set to none.\");\r\n\t\t\tassert.notEqual(getPropertyValue($target2, \"height\"), 0, \"slideUp: height reset.\");\r\n\t\t\tassert.equal(getPropertyValue($target1, \"paddingTop\"), initialStyles.paddingTop, \"slideUp: paddingTop reset.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\t//\t}).then(function(elements) {\r\n\t\t//\t\tassert.deepEqual(elements, [$target2], \"slideUp: Promise fulfilled.\");\r\n\t\t//\r\n\t\t//\t\tdone();\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {completeCheckDuration, defaultOptions, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Call Options\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\tUICallOptions1 = {\r\n\t\t\tdelay: 123,\r\n\t\t\tduration: defaultOptions.duration,\r\n\t\t\teasing: \"spring\", // Should get ignored\r\n\t\t},\r\n\t\t$target1 = getTarget();\r\n\r\n\t//assert.expect(1);\r\n\tVelocity($target1, \"transition.slideLeftIn\", UICallOptions1);\r\n\r\n\tsetTimeout(() => {\r\n\t\t// Note: We can do this because transition.slideLeftIn is composed of a single call.\r\n\t\t//\t\tassert.equal(Data($target1).opts.delay, UICallOptions1.delay, \"Whitelisted option passed in.\");\r\n\t\t//\t\tassert.notEqual(Data($target1).opts.easing, UICallOptions1.easing, \"Non-whitelisted option not passed in #1a.\");\r\n\t\t//\t\tassert.equal(!/velocity-animating/.test(Data($target1).className), true, \"Duration option passed in.\");\r\n\r\n\t\tdone();\r\n\t}, completeCheckDuration);\r\n\r\n\tconst UICallOptions2 = {\r\n\t\tstagger: 100,\r\n\t\tduration: defaultOptions.duration,\r\n\t\tbackwards: true,\r\n\t};\r\n\r\n\tconst $targets = [getTarget(), getTarget(), getTarget()];\r\n\tVelocity($targets, \"transition.slideLeftIn\", UICallOptions2);\r\n\r\n\tsetTimeout(() => {\r\n\t\t//\t\tassert.equal(Data($targets[0]).opts.delay, UICallOptions2.stagger * 2, \"Backwards stagger delay passed in #1a.\");\r\n\t\t//\t\tassert.equal(Data($targets[1]).opts.delay, UICallOptions2.stagger * 1, \"Backwards stagger delay passed in #1b.\");\r\n\t\t//\t\tassert.equal(Data($targets[2]).opts.delay, UICallOptions2.stagger * 0, \"Backwards stagger delay passed in #1c.\");\r\n\r\n\t\tdone();\r\n\t}, completeCheckDuration);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"Callbacks\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\t$targets = [getTarget(), getTarget()];\r\n\r\n\tassert.expect(3);\r\n\tVelocity($targets, \"transition.bounceIn\", {\r\n\t\tbegin(elements) {\r\n\t\t\tassert.deepEqual(elements, $targets, \"Begin callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\tcomplete(elements) {\r\n\t\t\tassert.deepEqual(elements, $targets, \"Complete callback returned.\");\r\n\r\n\t\t\tdone();\r\n\t\t},\r\n\t\t//\t}).then(function(elements) {\r\n\t\t//\t\tassert.deepEqual(elements, $targets, \"Promise fulfilled.\");\r\n\t\t//\r\n\t\t//\t\tdone();\r\n\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {asyncCheckDuration, completeCheckDuration, defaultOptions, getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"In/Out\", (assert) => {\r\n\tconst done = assert.async(2),\r\n\t\t$target1 = getTarget(),\r\n\t\t$target2 = getTarget(),\r\n\t\t$target3 = getTarget(),\r\n\t\t$target4 = getTarget(),\r\n\t\t$target5 = getTarget(),\r\n\t\t$target6 = getTarget();\r\n\r\n\tVelocity($target1, \"transition.bounceIn\", defaultOptions.duration);\r\n\r\n\tVelocity($target2, \"transition.bounceIn\", {duration: defaultOptions.duration, display: \"inline\"});\r\n\r\n\tVelocity($target3, \"transition.bounceOut\", defaultOptions.duration);\r\n\r\n\tVelocity($target4, \"transition.bounceOut\", {duration: defaultOptions.duration, display: null});\r\n\r\n\t$target5.style.visibility = \"hidden\";\r\n\tVelocity($target5, \"transition.bounceIn\", {duration: defaultOptions.duration, visibility: \"visible\"});\r\n\r\n\t$target6.style.visibility = \"visible\";\r\n\tVelocity($target6, \"transition.bounceOut\", {duration: defaultOptions.duration, visibility: \"hidden\"});\r\n\r\n\tassert.expect(8);\r\n\tsetTimeout(() => {\r\n\t\tassert.notEqual(getPropertyValue($target3, \"display\"), 0, \"Out: display not prematurely set to none.\");\r\n\t\tassert.notEqual(getPropertyValue($target6, \"visibility\"), \"hidden\", \"Out: visibility not prematurely set to hidden.\");\r\n\r\n\t\tdone();\r\n\t}, asyncCheckDuration);\r\n\r\n\tsetTimeout(() => {\r\n\t\t//\t\tassert.equal(getPropertyValue($target1, \"display\"), Values.getDisplayType($target1), \"In: display set to default.\");\r\n\t\tassert.equal(getPropertyValue($target2, \"display\"), \"inline\", \"In: Custom inline value set.\");\r\n\r\n\t\tassert.equal(getPropertyValue($target3, \"display\"), 0, \"Out: display set to none.\");\r\n\t\t//\t\tassert.equal(getPropertyValue($target4, \"display\"), Values.getDisplayType($target3), \"Out: No display value set.\");\r\n\r\n\t\tassert.equal(getPropertyValue($target5, \"visibility\"), \"visible\", \"In: visibility set to visible.\");\r\n\t\tassert.equal(getPropertyValue($target6, \"visibility\"), \"hidden\", \"Out: visibility set to hidden.\");\r\n\r\n\t\tdone();\r\n\t}, completeCheckDuration);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"RegisterEffect\", (assert) => {\r\n//\tconst done = assert.async(1),\r\n//\t\teffectDefaultDuration = 800;\r\n//\r\n//\tassert.expect(2);\r\n//\tVelocity.RegisterEffect(\"callout.twirl\", {\r\n//\t\tdefaultDuration: effectDefaultDuration,\r\n//\t\tcalls: [\r\n//\t\t\t[{rotateZ: 1080}, 0.5],\r\n//\t\t\t[{scaleX: 0.5}, 0.25, {easing: \"spring\"}],\r\n//\t\t\t[{scaleX: 1}, 0.25, {easing: \"spring\"}],\r\n//\t\t],\r\n//\t});\r\n//\r\n//\tconst $target1 = getTarget();\r\n//\tVelocity($target1, \"callout.twirl\");\r\n//\r\n//\tsetTimeout(() => {\r\n//\t\tassert.equal(parseFloat(getPropertyValue($target1, \"rotateZ\") as string), 1080, \"First call's property animated.\");\r\n//\t\tassert.equal(parseFloat(getPropertyValue($target1, \"scaleX\") as string), 1, \"Last call's property animated.\");\r\n//\r\n//\t\tdone();\r\n//\t}, effectDefaultDuration * 1.5);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity from \"velocity-animate\";\r\nimport {defaultProperties, getPropertyValue, getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"RunSequence\", (assert) => {\r\n\t//\r\n\t//\tvar done = assert.async(1),\r\n\t//\t\t$target1 = getTarget(),\r\n\t//\t\t$target2 = getTarget(),\r\n\t//\t\t$target3 = getTarget(),\r\n\t//\t\tmySequence = [\r\n\t//\t\t\t{elements: $target1, properties: {opacity: defaultProperties.opacity}},\r\n\t//\t\t\t{elements: $target2, properties: {height: defaultProperties.height}},\r\n\t//\t\t\t{\r\n\t//\t\t\t\telements: $target3, properties: {width: defaultProperties.width}, options: {\r\n\t//\t\t\t\t\tdelay: 100,\r\n\t//\t\t\t\t\tsequenceQueue: false,\r\n\t//\t\t\t\t\tcomplete: function() {\r\n\t//\t\t\t\t\t\tassert.equal(parseFloat(getPropertyValue($target1, \"opacity\") as string), defaultProperties.opacity, \"First call's property animated.\");\r\n\t//\t\t\t\t\t\tassert.equal(parseFloat(getPropertyValue($target2, \"height\") as string), defaultProperties.height, \"Second call's property animated.\");\r\n\t//\t\t\t\t\t\tassert.equal(parseFloat(getPropertyValue($target3, \"width\") as string), defaultProperties.width, \"Last call's property animated.\");\r\n\t//\r\n\t//\t\t\t\t\t\tdone();\r\n\t//\t\t\t\t\t}\r\n\t//\t\t\t\t}\r\n\t//\t\t\t}\r\n\t//\t\t];\r\n\t//\r\n\t//\tassert.expect(3);\r\n\t//\tVelocity.RunSequence(mySequence);\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {HTMLorSVGElement} from \"velocity-animate\";\r\nimport {getTarget} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.skip(\"GenericReordering\", (assert) => {\r\n\t//\tfunction genericReordering(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\t//\t\tif (propertyValue === undefined) {\r\n\t//\t\t\tpropertyValue = Velocity(element, \"style\", \"textShadow\");\r\n\t//\t\t\tconst split = propertyValue.split(/\\s/g),\r\n\t//\t\t\t\tfirstPart = split[0];\r\n\t//\t\t\tlet newValue = \"\";\r\n\t//\r\n\t//\t\t\tif (Velocity.CSS.ColorNames[firstPart]) {\r\n\t//\t\t\t\tsplit.shift();\r\n\t//\t\t\t\tsplit.push(firstPart);\r\n\t//\t\t\t\tnewValue = split.join(\" \");\r\n\t//\t\t\t} else if (firstPart.match(/^#|^hsl|^rgb|-gradient/)) {\r\n\t//\t\t\t\tconst matchedString = propertyValue.match(/(hsl.*\\)|#[\\da-fA-F]+|rgb.*\\)|.*gradient.*\\))\\s/g)[0];\r\n\t//\r\n\t//\t\t\t\tnewValue = propertyValue.replace(matchedString, \"\") + \" \" + matchedString.trim();\r\n\t//\t\t\t} else {\r\n\t//\t\t\t\tnewValue = propertyValue;\r\n\t//\t\t\t}\r\n\t//\t\t\treturn newValue;\r\n\t//\t\t}\r\n\t//\t}\r\n\t//\r\n\t//\tVelocity(\"registerNormalization\", \"Element\", \"genericReordering\", genericReordering);\r\n\t//\r\n\t//\tlet tests = [\r\n\t//\t\t{\r\n\t//\t\t\ttest: \"hsl(16, 100%, 66%) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px hsl(16, 100%, 66%)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"-webkit-linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px -webkit-linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"-o-linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px -o-linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"-moz-linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px -moz-linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"linear-gradient(red, yellow) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px linear-gradient(rgba(255,0,0,1), rgba(255,255,0,1))\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"red 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(255,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"#000000 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"rgb(0, 0, 0) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"rgba(0, 0, 0, 1) 1px 1px 1px\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t}, {\r\n\t//\t\t\ttest: \"1px 1px 1px rgb(0, 0, 0)\",\r\n\t//\t\t\tresult: \"1px 1px 1px rgba(0,0,0,1)\",\r\n\t//\t\t},\r\n\t//\t];\r\n\t//\r\n\t//\tfor (let test of tests) {\r\n\t//\t\tlet element = getTarget();\r\n\t//\r\n\t//\t\telement.velocity(\"style\", \"textShadow\", test.test);\r\n\t//\t\tassert.equal(element.velocity(\"style\", \"genericReordering\"), test.result, test.test);\r\n\t//\t}\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Display\", (assert) => {\r\n\tconst done = assert.async(5);\r\n\r\n\tVelocity(getTarget(), \"style\", \"display\", \"none\")\r\n\t\t.velocity({display: \"block\"}, {\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"block\", \"Display:'block' was set immediately.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t}),\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), \"style\", \"display\", \"none\")\r\n\t\t.velocity(\"style\", \"display\", \"auto\")\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements[0].style.display, \"block\", \"Display:'auto' was understood.\");\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"block\", \"Display:'auto' was cached as 'block'.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), \"style\", \"display\", \"none\")\r\n\t\t.velocity(\"style\", \"display\", \"\")\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"block\", \"Display:'' was reset correctly.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), {display: \"none\"}, {\r\n\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\tassert.notEqual(elements.velocity(\"style\", \"display\"), \"none\", \"Display:'none' was not set immediately.\");\r\n\r\n\t\t\tdone();\r\n\t\t}),\r\n\t})\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"display\"), \"none\", \"Display:'none' was set upon completion.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\nimport \"qunit\";\r\n\r\nimport Velocity, {VelocityResult} from \"velocity-animate\";\r\nimport {getTarget, once} from \"../utilities\";\r\nimport \"./_module\";\r\n\r\nQUnit.test(\"Visibility\", (assert) => {\r\n\tconst done = assert.async(4);\r\n\r\n\tVelocity(getTarget(), \"style\", \"visibility\", \"hidden\")\r\n\t\t.velocity({visibility: \"visible\"}, {\r\n\t\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\t\tassert.equal(elements.velocity(\"style\", \"visibility\"), \"visible\", \"Visibility:'visible' was set immediately.\");\r\n\r\n\t\t\t\tdone();\r\n\t\t\t}),\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), \"style\", \"visibility\", \"hidden\")\r\n\t\t.velocity(\"style\", \"visibility\", \"\")\r\n\t\t.then((elements) => {\r\n\t\t\t// NOTE: The test elements inherit \"hidden\", so while illogical it\r\n\t\t\t// is in fact correct.\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"visibility\"), \"hidden\", \"Visibility:'' was reset correctly.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n\r\n\tVelocity(getTarget(), {visibility: \"hidden\"}, {\r\n\t\tprogress: once((elements: VelocityResult) => {\r\n\t\t\tassert.notEqual(elements.velocity(\"style\", \"visibility\"), \"visible\", \"Visibility:'hidden' was not set immediately.\");\r\n\r\n\t\t\tdone();\r\n\t\t}),\r\n\t})\r\n\t\t.then((elements) => {\r\n\t\t\tassert.equal(elements.velocity(\"style\", \"visibility\"), \"hidden\", \"Visibility:'hidden' was set upon completion.\");\r\n\r\n\t\t\tdone();\r\n\t\t});\r\n});\r\n"],"names":["isMobile","test","navigator","userAgent","isAndroid","defaultStyles","opacity","width","height","marginBottom","colorGreen","textShadowBlur","defaultProperties","String","defaultOptions","queue","duration","easing","begin","complete","progress","loop","delay","mobileHA","$","window","jQuery","Zepto","$qunitStage","document","getElementById","asyncCheckDuration","completeCheckDuration","IE","documentMode","i","div","createElement","innerHTML","getElementsByTagName","length","undefined","targets","asyncCount","QUnit","config","reorder","element","startValues","each","property","startValue","style","jquery","velocityData","performance","now","Date","Velocity","className","color","textShadow","appendChild","push","applyStartValues","func","done","result","apply","arguments","ms","Promise","resolve","setTimeout","assert","count","callback","oldCount","async","testDone","querySelectorAll","velocity","removeChild","pop","asyncTests","defaults","reset","details","console","log","total","failed","passed","runtime","testComplete","testDuration","testEasing","testOptions","expect","getTarget","ok","animations","equal","options","elements","properties","newProperties","then","Data","cache","testStartValues","paddingLeft","paddingRight","marginLeft","marginTop","lineHeight","wordSpacing","backgroundColor","$target1","$target2","parseFloat","testPropertiesEndNoConvert","$target3","testPropertiesEndConvert","parentWidth","clientWidth","parentHeight","clientHeight","parentFontSize","remSize","body","$target4","parseInt","Math","floor","parentElement","offsetWidth","testPropertiesTRBL","left","$TRBLContainer","setAttribute","$target5","position","round","$target","sleep","getPropertyValue","$targetSet","deepEqual","testDelay","start","getNow","activeCall","close","success","e","easingBezierArray","easingBezierTestPercent","easingBezierTestValue","animation","easingSpringRK4Array","easingSpringRK4TestPercent","easingSpringRK4TestValue","easingStepArray","easingStepTestPercent","easingStepTestValue","once","frameRates","testFrame","frameRate","counter","fpsLimit","lastPercentComplete","percentComplete","msRemaining","testQueue","ignore","data","anim1","anim2","queueList","anim3","repeat","startDelay","speed","__start","actual","expected","__count","sync","notOk","top","complete1","complete2","skip","startOpacity","begin1","begin2","anim","raises","module","borderColor","testStartWidth","testStartWidthToPx","testStartHeight","all","promise","todo","testWidth","initialStyles","display","paddingTop","notEqual","UICallOptions1","UICallOptions2","stagger","backwards","$targets","$target6","visibility"],"mappings":";;;;;;;;;;;;;;CA2BO,IAAMA,WAAW,iEAAiEC,IAAjE,CAAsEC,UAAUC,SAAhF,CAAjB;CAAA,IACNC,YAAY,WAAWH,IAAX,CAAg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CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CA5DD;CA8DA;CACA9B,MAAMsJ,IAAN,CAAW,kBAAX,EAA+B,UAACxH,MAAD;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CA/GD;;;;CChEA9B,MAAM3C,IAAN,CAAW,MAAX,EAAmB,UAAOyE,MAAP;CAAA;;;;;;;CAClBU,mCAAWV,MAAX,EAAmB,CAAnB,EAAsB,UAACR,IAAD;CACrBR,qCAASyC,WAAT,EAAsB,MAAtB;CACAzB,mCAAO0B,EAAP,CAAU,IAAV,EAAgB,oEAAhB;CAEAlC;CACA,yBALD;CAOAkB,mCAAWV,MAAX,EAAmB,CAAnB,EAAsB,UAACR,IAAD;CACrB,gCAAM8E,UAAU7C,WAAhB;CAEAzC,qCAASsF,OAAT,EAAkBp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D,CAAvD,EAA0D,2CAA1D;CACAhD,eAAO0I,QAAP,CAAgBlE,iBAAiBwE,QAAjB,EAA2B,YAA3B,CAAhB,EAA0D,QAA1D,EAAoE,gDAApE;CAEAxJ;CACA,KALD,EAKGnC,kBALH;CAOA0C,eAAW;CACV;CACAC,eAAO4B,KAAP,CAAa4C,iBAAiB3B,QAAjB,EAA2B,SAA3B,CAAb,EAAoD,QAApD,EAA8D,8BAA9D;CAEA7C,eAAO4B,KAAP,CAAa4C,iBAAiBxB,QAAjB,EAA2B,SAA3B,CAAb,EAAoD,CAApD,EAAuD,2BAAvD;CACA;CAEAhD,eAAO4B,KAAP,CAAa4C,iBAAiBL,QAAjB,EAA2B,YAA3B,CAAb,EAAuD,SAAvD,EAAkE,gCAAlE;CACAnE,eAAO4B,KAAP,CAAa4C,iBAAiBwE,QAAjB,EAA2B,YAA3B,CAAb,EAAuD,QAAvD,EAAiE,gCAAjE;CAEAxJ;CACA,KAXD,EAWGlC,qBAXH;CAYA,CA3CD;;;8CCA6B;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACC,CAvBD;;;;CCCC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CA1BD;;;;;;2CCAiC0C,MAAD;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,C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.d.ts b/velocity.d.ts index d1387b87..be2776f5 100644 --- a/velocity.d.ts +++ b/velocity.d.ts @@ -646,12 +646,28 @@ export type VelocityElements = HTMLorSVGElement | HTMLorSVGElement[] | VelocityR * Chaining Velocity calls from various sources. */ export interface VelocityExtended { - velocity: Velocity & VelocityChain & { + /** + * This is the actual Promise used by Velocity. If using Promise.all() or + * similar methods then you may need to use this instead of the Velocity + * result itself. + */ + readonly promise: Promise; + /** + * This is the Velocity chaining method. It is functionally equivalent to + * the normal Velocity call, but allows chaining on the elements it is + * attached to. + */ + readonly velocity: Velocity & { /** + * These are the animation objects attached to this specific chain. This + * is used in some actions to allow the call to only touch the specific + * animations called rather than just the animations on the linked + * elements. + * * TODO: Decide if this should be public * @private */ - animations: AnimationCall[]; + readonly animations: AnimationCall[]; }; } @@ -816,7 +832,7 @@ export interface ElementData { /** * Direct Velocity access. */ -export interface Velocity { +export interface Velocity extends VelocityChain { /** * Available to be able to check what version you're running against. */ diff --git a/velocity.es5.js b/velocity.es5.js index 7b235627..f1bcdec2 100644 --- a/velocity.es5.js +++ b/velocity.es5.js @@ -1450,6 +1450,7 @@ function setPropertyValue(element, propertyName, propertyValue, fn) { } } } +//# sourceMappingURL=setPropertyValue.js.map /** * Cache every camelCase match to avoid repeating lookups. @@ -4292,21 +4293,18 @@ function Velocity$1() { // Due to being an async call, they should be back to "normal" // before the .then() function gets called. resolver = function resolver(result) { - if (isVelocityResult(result)) { - var then = result && result.then; - if (then) { - result.then = undefined; // Preserving enumeration etc - } + if (isVelocityResult(result) && result.then) { + var then = result.then; + result.then = undefined; // Preserving enumeration etc resolve(result); - if (then) { - result.then = then; - } + result.then = then; } else { resolve(result); } }; }); if (elements) { + defineProperty$1(elements, "promise", promise); defineProperty$1(elements, "then", promise.then.bind(promise)); defineProperty$1(elements, "catch", promise.catch.bind(promise)); if (promise.finally) { @@ -4548,7 +4546,6 @@ function Velocity$1() { /* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */ return elements || promise; } -//# sourceMappingURL=velocityFn.js.map // Project /** diff --git a/velocity.es5.js.map b/velocity.es5.js.map index ca8068f0..0bf1b1ec 100644 --- a/velocity.es5.js.map +++ b/velocity.es5.js.map @@ -1 +1 @@ -{"version":3,"file":"velocity.es5.js","sources":["src/types.ts","src/utility.ts","src/Velocity/actions/actions.ts","src/constants.ts","src/Velocity/easing/easings.ts","src/Velocity/easing/bezier.ts","src/Velocity/easing/spring_rk4.ts","src/Velocity/easing/step.ts","src/Velocity/options.ts","src/Velocity/defaults.ts","src/Velocity/normalizations/normalizationsObject.ts","src/Velocity/data.ts","src/Velocity/state.ts","src/Velocity/queue.ts","src/Velocity/complete.ts","src/Velocity/normalizations/normalizations.ts","src/Velocity/css/setPropertyValue.ts","src/Velocity/camelCase.ts","src/Velocity/css/fixColors.ts","src/Velocity/css/augmentDimension.ts","src/Velocity/css/getPropertyValue.ts","src/Velocity/tweens.ts","src/Velocity/tick.ts","src/Velocity/actions/finish.ts","src/Velocity/actions/option.ts","src/Velocity/actions/pauseResume.ts","src/Velocity/actions/reverse.ts","src/Velocity/actions/stop.ts","src/Velocity/actions/style.ts","src/Velocity/actions/tween.ts","src/Velocity/css/colors.ts","src/Velocity/easing/back.ts","src/Velocity/easing/bounce.ts","src/Velocity/easing/elastic.ts","src/Velocity/easing/string.ts","src/Velocity/normalizations/dimensions.ts","src/Velocity/normalizations/display.ts","src/Velocity/normalizations/scroll.ts","src/Velocity/normalizations/style.ts","src/Velocity/normalizations/svg/attributes.ts","src/Velocity/normalizations/svg/dimensions.ts","src/Velocity/normalizations/tween.ts","version.ts","src/velocity.ts","src/Velocity/sequences.ts","src/velocityFn.ts","src/Velocity/patch.ts","src/velocity.ts"],"sourcesContent":["/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Runtime type checking methods.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityResult} from \"./../velocity.d\";\r\n\r\n/**\r\n * Check if a variable is a boolean.\r\n */\r\nexport function isBoolean(variable: any): variable is boolean {\r\n\treturn variable === true || variable === false;\r\n}\r\n\r\n/**\r\n * Check if a variable is an empty object.\r\n */\r\nexport function isEmptyObject(variable: {}): variable is {} {\r\n\tfor (const name in variable) {\r\n\t\tif (variable.hasOwnProperty(name)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Check if a variable is a function.\r\n */\r\nexport function isFunction(variable: any): variable is Function { // tslint:disable-line:ban-types\r\n\treturn Object.prototype.toString.call(variable) === \"[object Function]\";\r\n}\r\n\r\n/**\r\n * Check if a variable is an HTMLElement or SVGElement.\r\n */\r\nexport function isNode(variable: any): variable is HTMLorSVGElement {\r\n\treturn !!(variable && (variable as Element).nodeType);\r\n}\r\n\r\n/**\r\n * Check if a variable is a number.\r\n */\r\nexport function isNumber(variable: any): variable is number {\r\n\treturn typeof variable === \"number\";\r\n}\r\n\r\n/**\r\n * Faster way to parse a string/number as a number https://jsperf.com/number-vs-parseint-vs-plus/3\r\n */\r\nexport function isNumberWhenParsed(variable: any): variable is number {\r\n\treturn !isNaN(Number(variable));\r\n}\r\n\r\n/**\r\n * Check if a variable is a plain object (and not an instance).\r\n */\r\nexport function isPlainObject(variable: any): variable is {} {\r\n\tif (!variable || typeof variable !== \"object\" || (variable as Element).nodeType || Object.prototype.toString.call(variable) !== \"[object Object]\") {\r\n\t\treturn false;\r\n\t}\r\n\tconst proto = Object.getPrototypeOf(variable) as object;\r\n\r\n\treturn !proto || (proto.hasOwnProperty(\"constructor\") && proto.constructor === Object);\r\n}\r\n\r\n/**\r\n * Check if a variable is an SVGElement.\r\n */\r\nexport function isSVG(variable: any): variable is SVGElement {\r\n\treturn SVGElement && variable instanceof SVGElement;\r\n}\r\n\r\n/**\r\n * Check if a variable is a string.\r\n */\r\nexport function isString(variable: any): variable is string {\r\n\treturn typeof variable === \"string\";\r\n}\r\n\r\n/**\r\n * Check if a variable is the result of calling Velocity.\r\n */\r\nexport function isVelocityResult(variable: any): variable is VelocityResult {\r\n\treturn variable && isNumber((variable as VelocityResult).length) && isFunction((variable as VelocityResult).velocity);\r\n}\r\n\r\n/**\r\n * Check if a variable is an array-like wrapped jQuery, Zepto or similar, where\r\n * each indexed value is a Node.\r\n */\r\n\r\nexport function isWrapped(variable: any): variable is HTMLorSVGElement[] {\r\n\treturn variable\r\n\t\t&& variable !== window\r\n\t\t&& isNumber((variable as HTMLorSVGElement[]).length)\r\n\t\t&& !isString(variable)\r\n\t\t&& !isFunction(variable)\r\n\t\t&& !isNode(variable)\r\n\t\t&& ((variable as HTMLorSVGElement[]).length === 0 || isNode(variable[0]));\r\n}\r\n\r\n/**\r\n * Check is a property is an enumerable member of an object.\r\n */\r\nexport function propertyIsEnumerable(obj: object, property: string): boolean {\r\n\treturn Object.prototype.propertyIsEnumerable.call(obj, property);\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isNode} from \"./types\";\r\n\r\n/**\r\n * Add a single className to an Element.\r\n */\r\nexport function addClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.add(className);\r\n\t\t} else {\r\n\t\t\tremoveClass(element, className);\r\n\t\t\t(element as any).className += (element.className.length ? \" \" : \"\") + className;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Clone an array, works for array-like too.\r\n */\r\nexport function cloneArray(arrayLike: T[] | ArrayLike): T[] {\r\n\treturn Array.prototype.slice.call(arrayLike, 0);\r\n}\r\n\r\n/**\r\n * The defineProperty() function provides a\r\n * shortcut to defining a property that cannot be accidentally iterated across.\r\n */\r\nexport function defineProperty(proto: any, name: string, value: any, readonly?: boolean) {\r\n\tif (proto) {\r\n\t\tObject.defineProperty(proto, name, {\r\n\t\t\tconfigurable: !readonly,\r\n\t\t\twritable: !readonly,\r\n\t\t\tvalue,\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * When there are multiple locations for a value pass them all in, then get the\r\n * first value that is valid.\r\n */\r\nexport function getValue(...args: T[]): T {\r\n\tfor (const arg of arguments) {\r\n\t\tif (arg !== undefined && arg === arg) {\r\n\t\t\treturn arg;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Shim to get the current milliseconds - on anything except old IE it'll use\r\n * Date.now() and save creating an object. If that doesn't exist then it'll\r\n * create one that gets GC.\r\n */\r\nexport const now = Date.now ? Date.now : () => {\r\n\treturn (new Date()).getTime();\r\n};\r\n\r\n/**\r\n * Remove a single className from an Element.\r\n */\r\nexport function removeClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.remove(className);\r\n\t\t} else {\r\n\t\t\t// TODO: Need some jsperf tests on performance - can we get rid of the regex and maybe use split / array manipulation?\r\n\t\t\t(element as any).className = element.className.replace(new RegExp(`(^|\\\\s)${className}(\\\\s|$)`, \"gi\"), \" \");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Convert an element or array-like element list into an array if needed.\r\n */\r\nexport function sanitizeElements(elements: HTMLorSVGElement | HTMLorSVGElement[]): HTMLorSVGElement[] {\r\n\treturn isNode(elements)\r\n\t\t? [elements] as HTMLorSVGElement[]\r\n\t\t: elements as HTMLorSVGElement[];\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityActionFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString, propertyIsEnumerable} from \"../../types\";\r\nimport {defineProperty} from \"../../utility\";\r\n\r\n// Constants\r\nexport const Actions: {[name: string]: VelocityActionFn} = {};\r\n\r\n/**\r\n * Used to register an action. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerAction\", \"name\", VelocityActionFn);\r\n */\r\nexport function registerAction(args?: [string, VelocityActionFn], internal?: boolean) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' callback to an invalid value:`, name, callback);\r\n\t} else if (Actions[name] && !propertyIsEnumerable(Actions, name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override internal 'registerAction' callback`, name);\r\n\t} else if (internal === true) {\r\n\t\tdefineProperty(Actions, name, callback);\r\n\t} else {\r\n\t\tActions[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerAction\", registerAction as any], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Constants and defaults. These values should never change without a MINOR\r\n * version bump.\r\n */\r\n\r\n/**\r\n * Without this it will only un-prefix properties that have a valid \"normal\"\r\n * version.\r\n */\r\nexport const ALL_VENDOR_PREFIXES = true;\r\n\r\nexport const DURATION_FAST = 200;\r\nexport const DURATION_NORMAL = 400;\r\nexport const DURATION_SLOW = 600;\r\n\r\nexport const FUZZY_MS_PER_SECOND = 980;\r\n\r\nexport const DEFAULT_CACHE = true;\r\nexport const DEFAULT_DELAY = 0;\r\nexport const DEFAULT_DURATION = DURATION_NORMAL;\r\nexport const DEFAULT_EASING = \"swing\";\r\nexport const DEFAULT_FPSLIMIT = 60;\r\nexport const DEFAULT_LOOP = 0;\r\nexport const DEFAULT_PROMISE = true;\r\nexport const DEFAULT_PROMISE_REJECT_EMPTY = true;\r\nexport const DEFAULT_QUEUE = \"\";\r\nexport const DEFAULT_REPEAT = 0;\r\nexport const DEFAULT_SPEED = 1;\r\nexport const DEFAULT_SYNC = true;\r\n\r\nexport const CLASSNAME = \"velocity-animating\";\r\n\r\nexport const Duration = {\r\n\tfast: DURATION_FAST,\r\n\tnormal: DURATION_NORMAL,\r\n\tslow: DURATION_SLOW,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\n\r\n// Constants\r\nexport const Easings: {[name: string]: VelocityEasingFn} = {};\r\n\r\n/**\r\n * Used to register a easing. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerEasing\", \"name\", VelocityEasingFn);\r\n */\r\nexport function registerEasing(args?: [string, VelocityEasingFn]) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' callback to an invalid value:`, name, callback);\r\n\t} else if (Easings[name]) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override 'registerEasing' callback`, name);\r\n\t} else {\r\n\t\tEasings[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerEasing\", registerEasing], true);\r\n\r\n/**\r\n * Linear easing, used for sequence parts that don't have an actual easing\r\n * function.\r\n */\r\nexport function linearEasing(percentComplete, startValue, endValue, property) {\r\n\treturn startValue + percentComplete * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * Swing is the default for jQuery and Velocity.\r\n */\r\nexport function swingEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (0.5 - Math.cos(percentComplete * Math.PI) / 2) * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * A less exaggerated version of easeInOutElastic.\r\n */\r\nexport function springEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (1 - (Math.cos(percentComplete * 4.5 * Math.PI) * Math.exp(-percentComplete * 6))) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"linear\", linearEasing]);\r\nregisterEasing([\"swing\", swingEasing]);\r\nregisterEasing([\"spring\", springEasing]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Fix to a range of 0 <= num <= 1.\r\n */\r\nfunction fixRange(num: number) {\r\n\treturn Math.min(Math.max(num, 0), 1);\r\n}\r\n\r\nfunction A(aA1, aA2) {\r\n\treturn 1 - 3 * aA2 + 3 * aA1;\r\n}\r\n\r\nfunction B(aA1, aA2) {\r\n\treturn 3 * aA2 - 6 * aA1;\r\n}\r\n\r\nfunction C(aA1) {\r\n\treturn 3 * aA1;\r\n}\r\n\r\nfunction calcBezier(aT, aA1, aA2) {\r\n\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\r\n}\r\n\r\nfunction getSlope(aT, aA1, aA2) {\r\n\treturn 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);\r\n}\r\n\r\nexport function generateBezier(mX1: number, mY1: number, mX2: number, mY2: number): VelocityEasingFn {\r\n\tconst NEWTON_ITERATIONS = 4,\r\n\t\tNEWTON_MIN_SLOPE = 0.001,\r\n\t\tSUBDIVISION_PRECISION = 0.0000001,\r\n\t\tSUBDIVISION_MAX_ITERATIONS = 10,\r\n\t\tkSplineTableSize = 11,\r\n\t\tkSampleStepSize = 1 / (kSplineTableSize - 1),\r\n\t\tfloat32ArraySupported = \"Float32Array\" in window;\r\n\r\n\t/* Must contain four arguments. */\r\n\tif (arguments.length !== 4) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/* Arguments must be numbers. */\r\n\tfor (let i = 0; i < 4; ++i) {\r\n\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\t/* X values must be in the [0, 1] range. */\r\n\tmX1 = fixRange(mX1);\r\n\tmX2 = fixRange(mX2);\r\n\r\n\tconst mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n\r\n\tfunction newtonRaphsonIterate(aX, aGuessT) {\r\n\t\tfor (let i = 0; i < NEWTON_ITERATIONS; ++i) {\r\n\t\t\tconst currentSlope = getSlope(aGuessT, mX1, mX2);\r\n\r\n\t\t\tif (currentSlope === 0) {\r\n\t\t\t\treturn aGuessT;\r\n\t\t\t}\r\n\r\n\t\t\tconst currentX = calcBezier(aGuessT, mX1, mX2) - aX;\r\n\t\t\taGuessT -= currentX / currentSlope;\r\n\t\t}\r\n\r\n\t\treturn aGuessT;\r\n\t}\r\n\r\n\tfunction calcSampleValues() {\r\n\t\tfor (let i = 0; i < kSplineTableSize; ++i) {\r\n\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction binarySubdivide(aX, aA, aB) {\r\n\t\tlet currentX, currentT, i = 0;\r\n\r\n\t\tdo {\r\n\t\t\tcurrentT = aA + (aB - aA) / 2;\r\n\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\r\n\t\t\tif (currentX > 0) {\r\n\t\t\t\taB = currentT;\r\n\t\t\t} else {\r\n\t\t\t\taA = currentT;\r\n\t\t\t}\r\n\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\r\n\r\n\t\treturn currentT;\r\n\t}\r\n\r\n\tfunction getTForX(aX) {\r\n\t\tconst lastSample = kSplineTableSize - 1;\r\n\t\tlet intervalStart = 0,\r\n\t\t\tcurrentSample = 1;\r\n\r\n\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\r\n\t\t\tintervalStart += kSampleStepSize;\r\n\t\t}\r\n\r\n\t\t--currentSample;\r\n\r\n\t\tconst dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\r\n\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\r\n\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\r\n\r\n\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\r\n\t\t\treturn newtonRaphsonIterate(aX, guessForT);\r\n\t\t} else if (initialSlope === 0) {\r\n\t\t\treturn guessForT;\r\n\t\t} else {\r\n\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\r\n\t\t}\r\n\t}\r\n\r\n\tlet precomputed = false;\r\n\r\n\tfunction precompute() {\r\n\t\tprecomputed = true;\r\n\t\tif (mX1 !== mY1 || mX2 !== mY2) {\r\n\t\t\tcalcSampleValues();\r\n\t\t}\r\n\t}\r\n\r\n\tconst str = `generateBezier(${[mX1, mY1, mX2, mY2]})`,\r\n\t\tf = (percentComplete: number, startValue: number, endValue: number, property?: string) => {\r\n\t\t\tif (!precomputed) {\r\n\t\t\t\tprecompute();\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 0) {\r\n\t\t\t\treturn startValue;\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 1) {\r\n\t\t\t\treturn endValue;\r\n\t\t\t}\r\n\t\t\tif (mX1 === mY1 && mX2 === mY2) {\r\n\t\t\t\treturn startValue + percentComplete * (endValue - startValue);\r\n\t\t\t}\r\n\r\n\t\t\treturn startValue + calcBezier(getTForX(percentComplete), mY1, mY2) * (endValue - startValue);\r\n\t\t};\r\n\r\n\t(f as any).getControlPoints = () => {\r\n\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\r\n\t};\r\n\tf.toString = () => {\r\n\t\treturn str;\r\n\t};\r\n\r\n\treturn f;\r\n}\r\n\r\n/* Common easings */\r\nconst easeIn = generateBezier(0.42, 0, 1, 1),\r\n\teaseOut = generateBezier(0, 0, 0.58, 1),\r\n\teaseInOut = generateBezier(0.42, 0, 0.58, 1);\r\n\r\nregisterEasing([\"ease\", generateBezier(0.25, 0.1, 0.25, 1)]);\r\nregisterEasing([\"easeIn\", easeIn]);\r\nregisterEasing([\"ease-in\", easeIn]);\r\nregisterEasing([\"easeOut\", easeOut]);\r\nregisterEasing([\"ease-out\", easeOut]);\r\nregisterEasing([\"easeInOut\", easeInOut]);\r\nregisterEasing([\"ease-in-out\", easeInOut]);\r\nregisterEasing([\"easeInSine\", generateBezier(0.47, 0, 0.745, 0.715)]);\r\nregisterEasing([\"easeOutSine\", generateBezier(0.39, 0.575, 0.565, 1)]);\r\nregisterEasing([\"easeInOutSine\", generateBezier(0.445, 0.05, 0.55, 0.95)]);\r\nregisterEasing([\"easeInQuad\", generateBezier(0.55, 0.085, 0.68, 0.53)]);\r\nregisterEasing([\"easeOutQuad\", generateBezier(0.25, 0.46, 0.45, 0.94)]);\r\nregisterEasing([\"easeInOutQuad\", generateBezier(0.455, 0.03, 0.515, 0.955)]);\r\nregisterEasing([\"easeInCubic\", generateBezier(0.55, 0.055, 0.675, 0.19)]);\r\nregisterEasing([\"easeOutCubic\", generateBezier(0.215, 0.61, 0.355, 1)]);\r\nregisterEasing([\"easeInOutCubic\", generateBezier(0.645, 0.045, 0.355, 1)]);\r\nregisterEasing([\"easeInQuart\", generateBezier(0.895, 0.03, 0.685, 0.22)]);\r\nregisterEasing([\"easeOutQuart\", generateBezier(0.165, 0.84, 0.44, 1)]);\r\nregisterEasing([\"easeInOutQuart\", generateBezier(0.77, 0, 0.175, 1)]);\r\nregisterEasing([\"easeInQuint\", generateBezier(0.755, 0.05, 0.855, 0.06)]);\r\nregisterEasing([\"easeOutQuint\", generateBezier(0.23, 1, 0.32, 1)]);\r\nregisterEasing([\"easeInOutQuint\", generateBezier(0.86, 0, 0.07, 1)]);\r\nregisterEasing([\"easeInExpo\", generateBezier(0.95, 0.05, 0.795, 0.035)]);\r\nregisterEasing([\"easeOutExpo\", generateBezier(0.19, 1, 0.22, 1)]);\r\nregisterEasing([\"easeInOutExpo\", generateBezier(1, 0, 0, 1)]);\r\nregisterEasing([\"easeInCirc\", generateBezier(0.6, 0.04, 0.98, 0.335)]);\r\nregisterEasing([\"easeOutCirc\", generateBezier(0.075, 0.82, 0.165, 1)]);\r\nregisterEasing([\"easeInOutCirc\", generateBezier(0.785, 0.135, 0.15, 0.86)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\ninterface springState {\r\n\tx: number;\r\n\tv: number;\r\n\ttension: number;\r\n\tfriction: number;\r\n}\r\n\r\ninterface springDelta {\r\n\tdx: number;\r\n\tdv: number;\r\n}\r\n\r\n/* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\r\n/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass\r\n then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\r\nfunction springAccelerationForState(state: springState) {\r\n\treturn (-state.tension * state.x) - (state.friction * state.v);\r\n}\r\n\r\nfunction springEvaluateStateWithDerivative(initialState: springState, dt: number, derivative: springDelta): springDelta {\r\n\tconst state = {\r\n\t\tx: initialState.x + derivative.dx * dt,\r\n\t\tv: initialState.v + derivative.dv * dt,\r\n\t\ttension: initialState.tension,\r\n\t\tfriction: initialState.friction,\r\n\t};\r\n\r\n\treturn {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t};\r\n}\r\n\r\nfunction springIntegrateState(state: springState, dt: number) {\r\n\tconst a = {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t},\r\n\t\tb = springEvaluateStateWithDerivative(state, dt * 0.5, a),\r\n\t\tc = springEvaluateStateWithDerivative(state, dt * 0.5, b),\r\n\t\td = springEvaluateStateWithDerivative(state, dt, c),\r\n\t\tdxdt = 1 / 6 * (a.dx + 2 * (b.dx + c.dx) + d.dx),\r\n\t\tdvdt = 1 / 6 * (a.dv + 2 * (b.dv + c.dv) + d.dv);\r\n\r\n\tstate.x = state.x + dxdt * dt;\r\n\tstate.v = state.v + dvdt * dt;\r\n\r\n\treturn state;\r\n}\r\n\r\nexport function generateSpringRK4(tension: number, friction: number): number;\r\nexport function generateSpringRK4(tension: number, friction: number, duration: number): VelocityEasingFn;\r\nexport function generateSpringRK4(tension: number, friction: number, duration?: number): any {\r\n\tconst initState: springState = {\r\n\t\tx: -1,\r\n\t\tv: 0,\r\n\t\ttension: parseFloat(tension as any) || 500,\r\n\t\tfriction: parseFloat(friction as any) || 20,\r\n\t},\r\n\t\tpath = [0],\r\n\t\ttolerance = 1 / 10000,\r\n\t\tDT = 16 / 1000,\r\n\t\thaveDuration = duration != null; // deliberate \"==\", as undefined == null != 0\r\n\tlet timeLapsed = 0,\r\n\t\tdt: number,\r\n\t\tlastState: springState;\r\n\r\n\t/* Calculate the actual time it takes for this animation to complete with the provided conditions. */\r\n\tif (haveDuration) {\r\n\t\t/* Run the simulation without a duration. */\r\n\t\ttimeLapsed = generateSpringRK4(initState.tension, initState.friction);\r\n\t\t/* Compute the adjusted time delta. */\r\n\t\tdt = (timeLapsed as number) / duration * DT;\r\n\t} else {\r\n\t\tdt = DT;\r\n\t}\r\n\r\n\twhile (true) {\r\n\t\t/* Next/step function .*/\r\n\t\tlastState = springIntegrateState(lastState || initState, dt);\r\n\t\t/* Store the position. */\r\n\t\tpath.push(1 + lastState.x);\r\n\t\ttimeLapsed += 16;\r\n\t\t/* If the change threshold is reached, break. */\r\n\t\tif (!(Math.abs(lastState.x) > tolerance && Math.abs(lastState.v) > tolerance)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\r\n\t computed path and returns a snapshot of the position according to a given percentComplete. */\r\n\treturn !haveDuration ? timeLapsed : (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + path[Math.floor(percentComplete * (path.length - 1))] * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details\r\n *\r\n * Step easing generator.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Constants\r\nconst cache: {[steps: number]: VelocityEasingFn} = {};\r\n\r\nexport function generateStep(steps): VelocityEasingFn {\r\n\tconst fn = cache[steps];\r\n\r\n\tif (fn) {\r\n\t\treturn fn;\r\n\t}\r\n\r\n\treturn cache[steps] = (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + Math.round(percentComplete * steps) * (1 / steps) * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Validation functions used for various types of data that can be supplied.\r\n * All errors are reported in the non-minified version for development. If a\r\n * validation fails then it should return undefined.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityCallback, VelocityEasingFn, VelocityEasingType, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {Duration} from \"../constants\";\r\nimport {isBoolean, isFunction, isNumber, isString} from \"../types\";\r\nimport {generateBezier} from \"./easing/bezier\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {generateSpringRK4} from \"./easing/spring_rk4\";\r\nimport {generateStep} from \"./easing/step\";\r\n\r\n/**\r\n * Parse a duration value and return an ms number. Optionally return a\r\n * default value if the number is not valid.\r\n */\r\nexport function parseDuration(duration: \"fast\" | \"normal\" | \"slow\" | number, def?: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tif (isNumber(duration)) {\r\n\t\treturn duration;\r\n\t}\r\n\tif (isString(duration)) {\r\n\t\treturn Duration[duration.toLowerCase()]\r\n\t\t\t|| parseFloat(duration.replace(\"ms\", \"\")\r\n\t\t\t\t.replace(\"s\", \"000\"));\r\n\t}\r\n\r\n\treturn def == null ? undefined : parseDuration(def);\r\n}\r\n\r\n/**\r\n * Validate a cache option.\r\n */\r\nexport function validateCache(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'cache' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a begin option.\r\n */\r\nexport function validateBegin(value: VelocityCallback): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'begin' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a complete option.\r\n */\r\nexport function validateComplete(value: VelocityCallback, noError?: true): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'complete' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a delay option.\r\n */\r\nexport function validateDelay(value: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed)) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'delay' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a duration option.\r\n */\r\nexport function validateDuration(value: \"fast\" | \"normal\" | \"slow\" | number, noError?: true): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'duration' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a easing option.\r\n */\r\nexport function validateEasing(value: VelocityEasingType, duration: number, noError?: true): VelocityEasingFn {\r\n\tif (isString(value)) {\r\n\t\t// Named easing\r\n\t\treturn Easings[value];\r\n\t}\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\t// TODO: We should only do these if the correct function exists - don't force loading.\r\n\tif (Array.isArray(value)) {\r\n\t\tif (value.length === 1) {\r\n\t\t\t// Steps\r\n\t\t\treturn generateStep(value[0]);\r\n\t\t}\r\n\t\tif (value.length === 2) {\r\n\t\t\t// springRK4 must be passed the animation's duration.\r\n\t\t\t// Note: If the springRK4 array contains non-numbers,\r\n\t\t\t// generateSpringRK4() returns an easing function generated with\r\n\t\t\t// default tension and friction values.\r\n\t\t\treturn generateSpringRK4(value[0], value[1], duration);\r\n\t\t}\r\n\t\tif (value.length === 4) {\r\n\t\t\t// Note: If the bezier array contains non-numbers, generateBezier()\r\n\t\t\t// returns undefined.\r\n\t\t\treturn generateBezier.apply(null, value) || false;\r\n\t\t}\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'easing' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a fpsLimit option.\r\n */\r\nexport function validateFpsLimit(value: number | false): number {\r\n\tif (value === false) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\treturn Math.min(parsed, 60);\r\n\t\t}\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'fpsLimit' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a loop option.\r\n */\r\nexport function validateLoop(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'loop' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a progress option.\r\n */\r\nexport function validateProgress(value: VelocityProgress): VelocityProgress {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'progress' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promise option.\r\n */\r\nexport function validatePromise(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promise' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promiseRejectEmpty option.\r\n */\r\nexport function validatePromiseRejectEmpty(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promiseRejectEmpty' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a queue option.\r\n */\r\nexport function validateQueue(value: string | false, noError?: true): string | false {\r\n\tif (value === false || isString(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'queue' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a repeat option.\r\n */\r\nexport function validateRepeat(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'repeat' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a speed option.\r\n */\r\nexport function validateSpeed(value: number): number {\r\n\tif (isNumber(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'speed' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a sync option.\r\n */\r\nexport function validateSync(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'sync' to an invalid value:`, value);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Velocity option defaults, which can be overriden by the user.\r\n */\r\n\r\n// Typedefs\r\nimport {StrictVelocityOptions, VelocityCallback, VelocityEasingType} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean} from \"../types\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateEasing, validateFpsLimit, validateLoop, validatePromise, validatePromiseRejectEmpty,\r\n\tvalidateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./options\";\r\n\r\n// Constants\r\nimport {\r\n\tDEFAULT_CACHE, DEFAULT_DELAY, DEFAULT_DURATION, DEFAULT_EASING, DEFAULT_FPSLIMIT,\r\n\tDEFAULT_LOOP, DEFAULT_PROMISE, DEFAULT_PROMISE_REJECT_EMPTY, DEFAULT_QUEUE, DEFAULT_REPEAT,\r\n\tDEFAULT_SPEED, DEFAULT_SYNC, FUZZY_MS_PER_SECOND,\r\n} from \"../constants\";\r\n\r\nexport const defaults: StrictVelocityOptions & {reset?: () => void} = {\r\n\tmobileHA: true,\r\n};\r\n\r\n// NOTE: Add the variable here, then add the default state in \"reset\" below.\r\nlet cache: boolean,\r\n\tbegin: VelocityCallback,\r\n\tcomplete: VelocityCallback,\r\n\tdelay: number,\r\n\tduration: number,\r\n\teasing: VelocityEasingType,\r\n\tfpsLimit: number,\r\n\tloop: number | true,\r\n\tmobileHA: boolean,\r\n\tminFrameTime: number,\r\n\tpromise: boolean,\r\n\tpromiseRejectEmpty: boolean,\r\n\tqueue: string | false,\r\n\trepeat: number | true,\r\n\tspeed: number,\r\n\tsync: boolean;\r\n\r\n// IMPORTANT: Make sure any new defaults get added to the actions/set.ts list\r\nObject.defineProperties(defaults, {\r\n\treset: {\r\n\t\tenumerable: true,\r\n\t\tvalue() {\r\n\t\t\tcache = DEFAULT_CACHE;\r\n\t\t\tbegin = undefined;\r\n\t\t\tcomplete = undefined;\r\n\t\t\tdelay = DEFAULT_DELAY;\r\n\t\t\tduration = DEFAULT_DURATION;\r\n\t\t\teasing = validateEasing(DEFAULT_EASING, DEFAULT_DURATION);\r\n\t\t\tfpsLimit = DEFAULT_FPSLIMIT;\r\n\t\t\tloop = DEFAULT_LOOP;\r\n\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / DEFAULT_FPSLIMIT;\r\n\t\t\tpromise = DEFAULT_PROMISE;\r\n\t\t\tpromiseRejectEmpty = DEFAULT_PROMISE_REJECT_EMPTY;\r\n\t\t\tqueue = DEFAULT_QUEUE;\r\n\t\t\trepeat = DEFAULT_REPEAT;\r\n\t\t\tspeed = DEFAULT_SPEED;\r\n\t\t\tsync = DEFAULT_SYNC;\r\n\t\t},\r\n\t},\r\n\tcache: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn cache;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcache = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tbegin: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn begin;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tbegin = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tcomplete: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn complete;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcomplete = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tdelay: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn delay;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tdelay = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tduration: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn duration;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tduration = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\teasing: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityEasingType {\r\n\t\t\treturn easing;\r\n\t\t},\r\n\t\tset(value: VelocityEasingType) {\r\n\t\t\tvalue = validateEasing(value, duration);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\teasing = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tfpsLimit: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn fpsLimit;\r\n\t\t},\r\n\t\tset(value: number | false) {\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tfpsLimit = value;\r\n\t\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tloop: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn loop;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tloop = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tmobileHA: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn mobileHA;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tif (isBoolean(value)) {\r\n\t\t\t\tmobileHA = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tminFrameTime: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn minFrameTime;\r\n\t\t},\r\n\t},\r\n\tpromise: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promise;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromise(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromise = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tpromiseRejectEmpty: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promiseRejectEmpty;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromiseRejectEmpty(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromiseRejectEmpty = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tqueue: {\r\n\t\tenumerable: true,\r\n\t\tget(): string | false {\r\n\t\t\treturn queue;\r\n\t\t},\r\n\t\tset(value: string | false) {\r\n\t\t\tvalue = validateQueue(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tqueue = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\trepeat: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn repeat;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\trepeat = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tspeed: {\r\n\t\tenumerable: true,\r\n\t\tget(): number {\r\n\t\t\treturn speed;\r\n\t\t},\r\n\t\tset(value: number) {\r\n\t\t\tvalue = validateSpeed(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tspeed = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tsync: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn sync;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateSync(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tsync = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n});\r\n\r\n// Reset to our default values, currently everything is undefined.\r\ndefaults.reset();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n/**\r\n * The highest type index for finding the best normalization for a property.\r\n */\r\nexport let MaxType: number = -1;\r\n\r\n/**\r\n * Unlike \"actions\", normalizations can always be replaced by users.\r\n */\r\nexport const Normalizations: {[name: string]: VelocityNormalizationsFn}[] = [];\r\n\r\n/**\r\n * Store a cross-reference to units to be added to specific normalization\r\n * functions if the user supplies a unit-less number.\r\n *\r\n * This is pretty much confined to adding \"px\" to several css properties.\r\n */\r\nexport const NormalizationUnits: {[unit: string]: VelocityNormalizationsFn[]} = {};\r\n\r\n/**\r\n * Any normalisations that should never be cached are listed here.\r\n * Faster than an array - https://jsperf.com/array-includes-and-find-methods-vs-set-has\r\n */\r\nexport const NoCacheNormalizations = new Set();\r\n\r\n/**\r\n * Used to define a constructor.\r\n */\r\nexport interface ClassConstructor {\r\n\tnew(): object;\r\n}\r\n\r\n/**\r\n * An array of classes used for the per-class normalizations. This\r\n * translates into a bitwise enum for quick cross-reference, and so that\r\n * the element doesn't need multiple instanceof calls every\r\n * frame.\r\n */\r\nexport const constructors: (ClassConstructor | string)[] = [];\r\n\r\n/**\r\n * A cache of the various constructors we've found and mapping to their real\r\n * name - saves expensive lookups.\r\n */\r\nexport const constructorCache = new Map();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {ElementData, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {constructors} from \"./normalizations/normalizationsObject\";\r\n\r\n// Constants\r\nconst dataName = \"velocityData\";\r\n\r\n/**\r\n * Get (and create) the internal data store for an element.\r\n */\r\nexport function Data(element: HTMLorSVGElement): ElementData {\r\n\t// Use a string member so Uglify doesn't mangle it.\r\n\tconst data = element[dataName];\r\n\r\n\tif (data) {\r\n\t\treturn data;\r\n\t}\r\n\tconst window = element.ownerDocument.defaultView;\r\n\tlet types = 0;\r\n\r\n\tfor (let index = 0; index < constructors.length; index++) {\r\n\t\tconst constructor = constructors[index];\r\n\r\n\t\tif (isString(constructor)) {\r\n\t\t\tif (element instanceof window[constructor]) {\r\n\t\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t} else if (element instanceof constructor) {\r\n\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n\t// Use an intermediate object so it errors on incorrect data.\r\n\tconst newData: ElementData = {\r\n\t\ttypes,\r\n\t\tcount: 0,\r\n\t\tcomputedStyle: null,\r\n\t\tcache: {} as any,\r\n\t\tqueueList: {},\r\n\t\tlastAnimationList: {},\r\n\t\tlastFinishList: {},\r\n\t\twindow,\r\n\t};\r\n\r\n\tObject.defineProperty(element, dataName, {\r\n\t\tvalue: newData,\r\n\t});\r\n\r\n\treturn newData;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityState} from \"../../velocity.d\";\r\n\r\n// Constants\r\nimport {CLASSNAME} from \"../constants\";\r\n\r\nconst isClient = window && window === window.window,\r\n\twindowScrollAnchor = isClient && window.pageYOffset !== undefined;\r\n\r\nexport const State: VelocityState = {\r\n\tisClient,\r\n\tisMobile: isClient && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\r\n\tisAndroid: isClient && /Android/i.test(navigator.userAgent),\r\n\tisGingerbread: isClient && /Android 2\\.3\\.[3-7]/i.test(navigator.userAgent),\r\n\tisChrome: isClient && (window as any).chrome,\r\n\tisFirefox: isClient && /Firefox/i.test(navigator.userAgent),\r\n\tprefixElement: isClient && document.createElement(\"div\"),\r\n\twindowScrollAnchor,\r\n\tscrollAnchor: windowScrollAnchor ? window : (!isClient || document.documentElement || document.body.parentNode || document.body),\r\n\tscrollPropertyLeft: windowScrollAnchor ? \"pageXOffset\" : \"scrollLeft\",\r\n\tscrollPropertyTop: windowScrollAnchor ? \"pageYOffset\" : \"scrollTop\",\r\n\tclassName: CLASSNAME,\r\n\tisTicking: false,\r\n\tfirst: undefined,\r\n\tlast: undefined,\r\n\tfirstNew: undefined,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * AnimationCall queue\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {addClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Simple queue management. Un-named queue is directly within the element data,\r\n * named queue is within an object within it.\r\n */\r\nfunction animate(animation: AnimationCall) {\r\n\tconst prev = State.last;\r\n\r\n\tanimation._prev = prev;\r\n\tanimation._next = undefined;\r\n\tif (prev) {\r\n\t\tprev._next = animation;\r\n\t} else {\r\n\t\tState.first = animation;\r\n\t}\r\n\tState.last = animation;\r\n\tif (!State.firstNew) {\r\n\t\tState.firstNew = animation;\r\n\t}\r\n\tconst element = animation.element,\r\n\t\tdata = Data(element);\r\n\r\n\tif (!data.count++) {\r\n\r\n\t\t////////////////////////\r\n\t\t// Feature: Classname //\r\n\t\t////////////////////////\r\n\r\n\t\taddClass(element, State.className);\r\n\t}\r\n}\r\n\r\n/**\r\n * Add an item to an animation queue.\r\n */\r\nexport function queue(element: HTMLorSVGElement, animation: AnimationCall, queueName: string | false): void {\r\n\tconst data = Data(element);\r\n\r\n\tif (queueName !== false) {\r\n\t\t// Store the last animation added so we can use it for the\r\n\t\t// beginning of the next one.\r\n\t\tdata.lastAnimationList[queueName] = animation;\r\n\t}\r\n\tif (queueName === false) {\r\n\t\tanimate(animation);\r\n\t} else {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tlet last = data.queueList[queueName];\r\n\r\n\t\tif (!last) {\r\n\t\t\tif (last === null) {\r\n\t\t\t\tdata.queueList[queueName] = animation;\r\n\t\t\t} else {\r\n\t\t\t\tdata.queueList[queueName] = null;\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twhile (last._next) {\r\n\t\t\t\tlast = last._next;\r\n\t\t\t}\r\n\t\t\tlast._next = animation;\r\n\t\t\tanimation._prev = last;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Start the next animation on this element's queue (named or default).\r\n *\r\n * @returns the next animation that is starting.\r\n */\r\nexport function dequeue(element: HTMLorSVGElement, queueName?: string | boolean, skip?: boolean): AnimationCall {\r\n\tif (queueName !== false) {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tconst data = Data(element),\r\n\t\t\tanimation = data.queueList[queueName];\r\n\r\n\t\tif (animation) {\r\n\t\t\tdata.queueList[queueName] = animation._next || null;\r\n\t\t\tif (!skip) {\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else if (animation === null) {\r\n\t\t\tdelete data.queueList[queueName];\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t}\r\n}\r\n\r\n/**\r\n * Remove an animation from the active animation list. If it has a queue set\r\n * then remember it as the last animation for that queue, and free the one\r\n * that was previously there. If the animation list is completely empty then\r\n * mark us as finished.\r\n */\r\nexport function freeAnimationCall(animation: AnimationCall): void {\r\n\tconst next = animation._next,\r\n\t\tprev = animation._prev,\r\n\t\tqueueName = animation.queue == null ? animation.options.queue : animation.queue;\r\n\r\n\tif (State.firstNew === animation) {\r\n\t\tState.firstNew = next;\r\n\t}\r\n\tif (State.first === animation) {\r\n\t\tState.first = next;\r\n\t} else if (prev) {\r\n\t\tprev._next = next;\r\n\t}\r\n\tif (State.last === animation) {\r\n\t\tState.last = prev;\r\n\t} else if (next) {\r\n\t\tnext._prev = prev;\r\n\t}\r\n\tif (queueName) {\r\n\t\tconst data = Data(animation.element);\r\n\r\n\t\tif (data) {\r\n\t\t\tanimation._next = animation._prev = undefined;\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Call Completion\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityCallback} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {getValue, removeClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {dequeue, freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Call the complete method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callComplete(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.complete as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Complete an animation. This might involve restarting (for loop or repeat\r\n * options). Once it is finished we also check for any callbacks or Promises\r\n * that need updating.\r\n */\r\nexport function completeCall(activeCall: AnimationCall) {\r\n\t// TODO: Check if it's not been completed already\r\n\tconst options = activeCall.options,\r\n\t\tqueue = getValue(activeCall.queue, options.queue),\r\n\t\tisLoop = getValue(activeCall.loop, options.loop, defaults.loop),\r\n\t\tisRepeat = getValue(activeCall.repeat, options.repeat, defaults.repeat),\r\n\t\tisStopped = activeCall._flags & AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\r\n\tif (!isStopped && (isLoop || isRepeat)) {\r\n\r\n\t\t////////////////////\r\n\t\t// Option: Loop //\r\n\t\t// Option: Repeat //\r\n\t\t////////////////////\r\n\r\n\t\tif (isRepeat && isRepeat !== true) {\r\n\t\t\tactiveCall.repeat = isRepeat - 1;\r\n\t\t} else if (isLoop && isLoop !== true) {\r\n\t\t\tactiveCall.loop = isLoop - 1;\r\n\t\t\tactiveCall.repeat = getValue(activeCall.repeatAgain, options.repeatAgain, defaults.repeatAgain);\r\n\t\t}\r\n\t\tif (isLoop) {\r\n\t\t\tactiveCall._flags ^= AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\tif (queue !== false) {\r\n\t\t\t// Can't be called when stopped so no need for an extra check.\r\n\t\t\tData(activeCall.element).lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t}\r\n\t\tactiveCall.timeStart = activeCall.ellapsedTime = activeCall.percentComplete = 0;\r\n\t\tactiveCall._flags &= ~AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t} else {\r\n\t\tconst element = activeCall.element,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (!--data.count && !isStopped) {\r\n\r\n\t\t\t////////////////////////\r\n\t\t\t// Feature: Classname //\r\n\t\t\t////////////////////////\r\n\r\n\t\t\tremoveClass(element, State.className);\r\n\t\t}\r\n\r\n\t\t//////////////////////\r\n\t\t// Option: Complete //\r\n\t\t//////////////////////\r\n\r\n\t\t// If this is the last animation in this list then we can check for\r\n\t\t// and complete calls or Promises.\r\n\t\t// TODO: When deleting an element we need to adjust these values.\r\n\t\tif (options && ++options._completed === options._total) {\r\n\t\t\tif (!isStopped && options.complete) {\r\n\t\t\t\t// We don't call the complete if the animation is stopped,\r\n\t\t\t\t// and we clear the key to prevent it being called again.\r\n\t\t\t\tcallComplete(activeCall);\r\n\t\t\t\toptions.complete = null;\r\n\t\t\t}\r\n\t\t\tconst resolver = options._resolver;\r\n\r\n\t\t\tif (resolver) {\r\n\t\t\t\t// Fulfil the Promise\r\n\t\t\t\tresolver(activeCall.elements as any);\r\n\t\t\t\tdelete options._resolver;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t///////////////////\r\n\t\t// Option: Queue //\r\n\t\t///////////////////\r\n\r\n\t\tif (queue !== false) {\r\n\t\t\t// We only do clever things with queues...\r\n\t\t\tif (!isStopped) {\r\n\t\t\t\t// If we're not stopping an animation, we need to remember\r\n\t\t\t\t// what time it finished so that the next animation in\r\n\t\t\t\t// sequence gets the correct start time.\r\n\t\t\t\tdata.lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t\t}\r\n\t\t\t// Start the next animation in sequence, or delete the queue if\r\n\t\t\t// this was the last one.\r\n\t\t\tdequeue(element, queue);\r\n\t\t}\r\n\t\t// Cleanup any pointers, and remember the last animation etc.\r\n\t\tfreeAnimationCall(activeCall);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\nimport {Data} from \"../data\";\r\nimport {ClassConstructor, constructorCache, constructors, NoCacheNormalizations, Normalizations, NormalizationUnits} from \"./normalizationsObject\";\r\n\r\n/**\r\n * Used to register a normalization. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerNormalization\", \"Element\", \"name\", VelocityNormalizationsFn[, false]);\r\n *\r\n * The second argument is the class of the animatable object. If this is passed\r\n * as a class name (ie, `\"Element\"` -> `window[\"Element\"]`) then this will work\r\n * cross-iframe. If passed as an actual class (ie `Element`) then it will\r\n * attempt to find the class on the window and use that name instead. If it\r\n * can't find it then it will use the class passed, which allows for custom\r\n * animation targets, but will not work cross-iframe boundary.\r\n *\r\n * The fourth argument can be an explicit false, which prevents\r\n * the property from being cached. Please note that this can be dangerous\r\n * for performance!\r\n */\r\nexport function registerNormalization(\r\n\targs?: [ClassConstructor | string, string, VelocityNormalizationsFn]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, boolean]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string, boolean]) {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1],\r\n\t\tcallback = args[2];\r\n\r\n\tif ((isString(constructor) && !(window[constructor] instanceof Object))\r\n\t\t|| (!isString(constructor) && !(constructor instanceof Object))) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' constructor to an invalid value:`, constructor);\r\n\t} else if (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' callback to an invalid value:`, name, callback);\r\n\t} else {\r\n\t\tlet index = constructors.indexOf(constructor),\r\n\t\t\tnextArg = 3;\r\n\r\n\t\tif (index < 0 && !isString(constructor)) {\r\n\t\t\tif (constructorCache.has(constructor)) {\r\n\t\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t\t} else {\r\n\t\t\t\tfor (const property in window) {\r\n\t\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t\t\tindex = constructors.push(property) - 1;\r\n\t\t\t\t\t\t\tNormalizations[index] = {};\r\n\t\t\t\t\t\t\tconstructorCache.set(constructor, property);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (index < 0) {\r\n\t\t\tindex = constructors.push(constructor) - 1;\r\n\t\t\tNormalizations[index] = {};\r\n\t\t}\r\n\t\tNormalizations[index][name] = callback;\r\n\t\tif (isString(args[nextArg])) {\r\n\t\t\tconst unit = args[nextArg++] as string;\r\n\t\t\tlet units = NormalizationUnits[unit];\r\n\r\n\t\t\tif (!units) {\r\n\t\t\t\tunits = NormalizationUnits[unit] = [];\r\n\t\t\t}\r\n\t\t\tunits.push(callback);\r\n\t\t}\r\n\t\tif (args[nextArg] === false) {\r\n\t\t\tNoCacheNormalizations.add(name);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to check if a normalisation exists on a specific class.\r\n */\r\nexport function hasNormalization(args?: [ClassConstructor | string, string]): boolean {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1];\r\n\tlet index = constructors.indexOf(constructor);\r\n\r\n\tif (index < 0 && !isString(constructor)) {\r\n\t\tif (constructorCache.has(constructor)) {\r\n\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t} else {\r\n\t\t\tfor (const property in window) {\r\n\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn index >= 0 && Normalizations[index].hasOwnProperty(name);\r\n}\r\n\r\n/**\r\n * Get the unit to add to a unitless number based on the normalization used.\r\n */\r\nexport function getNormalizationUnit(fn: VelocityNormalizationsFn) {\r\n\tfor (const unit in NormalizationUnits) {\r\n\t\tif (NormalizationUnits[unit].includes(fn)) {\r\n\t\t\treturn unit;\r\n\t\t}\r\n\t}\r\n\r\n\treturn \"\";\r\n}\r\n\r\n/**\r\n * Get the normalization for an element and propertyName combination. This\r\n * value should be cached at asking time, as it may change if the user adds\r\n * more normalizations.\r\n */\r\nexport function getNormalization(element: HTMLorSVGElement, propertyName: string) {\r\n\tconst data = Data(element);\r\n\tlet fn: VelocityNormalizationsFn;\r\n\r\n\tfor (let index = constructors.length - 1, types = data.types; !fn && index >= 0; index--) {\r\n\t\tif (types & (1 << index)) { // tslint:disable-line:no-bitwise\r\n\t\t\tfn = Normalizations[index][propertyName];\r\n\t\t}\r\n\t}\r\n\r\n\treturn fn;\r\n}\r\n\r\nregisterAction([\"registerNormalization\", registerNormalization]);\r\nregisterAction([\"hasNormalization\", hasNormalization]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\n\r\n/**\r\n * The singular setPropertyValue, which routes the logic for all\r\n * normalizations.\r\n */\r\nexport function setPropertyValue(element: HTMLorSVGElement, propertyName: string, propertyValue: any, fn?: VelocityNormalizationsFn) {\r\n\tconst noCache = NoCacheNormalizations.has(propertyName),\r\n\t\tdata = !noCache && Data(element);\r\n\r\n\tif (noCache || (data && data.cache[propertyName] !== propertyValue)) {\r\n\t\t// By setting it to undefined we force a true \"get\" later\r\n\t\tif (!noCache) {\r\n\t\t\tdata.cache[propertyName] = propertyValue || undefined;\r\n\t\t}\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tfn(element, propertyValue);\r\n\t\t}\r\n\t\tif (Velocity.debug >= 2) {\r\n\t\t\tconsole.info(`Set \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n/**\r\n * Cache every camelCase match to avoid repeating lookups.\r\n */\r\nconst cache: {[property: string]: string} = {};\r\n\r\n/**\r\n * Camelcase a property name into its JavaScript notation (e.g.\r\n * \"background-color\" ==> \"backgroundColor\"). Camelcasing is used to\r\n * normalize property names between and across calls.\r\n */\r\nexport function camelCase(property: string): string {\r\n\tconst fixed = cache[property];\r\n\r\n\tif (fixed) {\r\n\t\treturn fixed;\r\n\t}\r\n\r\n\treturn cache[property] = property.replace(/-([a-z])/g, ($: string, letter: string) => letter.toUpperCase());\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Constants\r\nconst rxColor6 = /#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/gi,\r\n\trxColor3 = /#([a-f\\d])([a-f\\d])([a-f\\d])/gi,\r\n\trxColorName = /(rgba?\\(\\s*)?(\\b[a-z]+\\b)/g,\r\n\trxRGB = /rgb(a?)\\(([^\\)]+)\\)/gi,\r\n\trxSpaces = /\\s+/g;\r\n\r\n/**\r\n * This is the list of color names -> rgb values. The object is in here so\r\n * that the actual name conversion can be in a separate file and not\r\n * included for custom builds.\r\n */\r\nexport const ColorNames: {[name: string]: string} = {};\r\n\r\n/**\r\n * Convert a hex list to an rgba value. Designed to be used in replace.\r\n */\r\nfunction makeRGBA(ignore: any, r: string, g: string, b: string): string {\r\n\treturn `rgba(${parseInt(r, 16)},${parseInt(g, 16)},${parseInt(b, 16)},1)`;\r\n}\r\n\r\n/**\r\n * Replace any css colour name with its rgba() value. It is possible to use\r\n * the name within an \"rgba(blue, 0.4)\" string this way.\r\n */\r\nexport function fixColors(str: string): string {\r\n\treturn str\r\n\t\t.replace(rxColor6, makeRGBA)\r\n\t\t.replace(rxColor3, ($0, r, g, b) => {\r\n\t\t\treturn makeRGBA($0, r + r, g + g, b + b);\r\n\t\t})\r\n\t\t.replace(rxColorName, ($0, $1, $2) => {\r\n\t\t\tif (ColorNames[$2]) {\r\n\t\t\t\treturn ($1 ? $1 : \"rgba(\") + ColorNames[$2] + ($1 ? \"\" : \",1)\");\r\n\t\t\t}\r\n\r\n\t\t\treturn $0;\r\n\t\t})\r\n\t\t.replace(rxRGB, ($0, $1, $2: string) => {\r\n\t\t\treturn `rgba(${$2.replace(rxSpaces, \"\") + ($1 ? \"\" : \",1\")})`;\r\n\t\t});\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"./getPropertyValue\";\r\n\r\n/**\r\n * Figure out the dimensions for this width / height based on the\r\n * potential borders and whether we care about them.\r\n */\r\nexport function augmentDimension(element: HTMLorSVGElement, name: \"width\" | \"height\", wantInner: boolean): number {\r\n\tconst isBorderBox = getPropertyValue(element, \"boxSizing\")\r\n\t\t.toString()\r\n\t\t.toLowerCase() === \"border-box\";\r\n\r\n\tif (isBorderBox === wantInner) {\r\n\t\t// in box-sizing mode, the CSS width / height accessors already\r\n\t\t// give the outerWidth / outerHeight.\r\n\t\tconst sides = name === \"width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\r\n\t\t\tfields = [`padding${sides[0]}`, `padding${sides[1]}`, `border${sides[0]}Width`, `border${sides[1]}Width`];\r\n\t\tlet augment = 0;\r\n\r\n\t\tfor (const field of fields) {\r\n\t\t\tconst value = parseFloat(getPropertyValue(element, field));\r\n\r\n\t\t\tif (!isNaN(value)) {\r\n\t\t\t\taugment += value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn wantInner ? -augment : augment;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\nimport {augmentDimension} from \"./augmentDimension\";\r\nimport {setPropertyValue} from \"./setPropertyValue\";\r\n\r\n/**\r\n * Get the width or height of an element, pulled out as it can be used when the\r\n * in two locations so don't want to repeat it.\r\n */\r\nfunction getWidthHeight(element: HTMLorSVGElement, property: \"width\" | \"height\"): string {\r\n\treturn (element.getBoundingClientRect()[property] + augmentDimension(element, property, true)) + \"px\";\r\n}\r\n\r\n// TODO: This is still a complete mess\r\nexport function computePropertyValue(element: HTMLorSVGElement, property: string): string {\r\n\tconst data = Data(element),\r\n\t\t// If computedStyle is cached, use it. If not then get the correct one\r\n\t\t// for the element to support cross-iframe boundaries.\r\n\t\tcomputedStyle = data.computedStyle ? data.computedStyle : data.window.getComputedStyle(element, null);\r\n\tlet computedValue: string | number = 0;\r\n\r\n\tif (!data.computedStyle) {\r\n\t\tdata.computedStyle = computedStyle;\r\n\t}\r\n\tif (computedStyle[\"display\"] === \"none\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\t// Browsers do not return height and width values for elements\r\n\t\t\t\t// that are set to display:\"none\". Thus, we temporarily toggle\r\n\t\t\t\t// display to the element type's default value.\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"auto\");\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"none\");\r\n\r\n\t\t\t\treturn String(computedValue);\r\n\t\t}\r\n\t}\r\n\r\n\t/* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\r\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\r\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\r\n\t/* TODO: There is a borderColor normalisation in legacy/ - figure out where this is needed... */\r\n\r\n\tcomputedValue = computedStyle[property];\r\n\t/* Fall back to the property's style value (if defined) when computedValue returns nothing,\r\n\t which can happen when the element hasn't been painted. */\r\n\tif (!computedValue) {\r\n\t\tcomputedValue = element.style[property];\r\n\t}\r\n\t/* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\r\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\r\n\t effect as being set to 0, so no conversion is necessary.) */\r\n\t/* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\r\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\r\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\r\n\tif (computedValue === \"auto\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"top\":\r\n\t\t\tcase \"left\":\r\n\t\t\t\tconst topLeft = true;\r\n\t\t\tcase \"right\":\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tconst position = getPropertyValue(element, \"position\");\r\n\r\n\t\t\t\tif (position === \"fixed\" || (topLeft && position === \"absolute\")) {\r\n\t\t\t\t\t// Note: this has no pixel unit on its returned values,\r\n\t\t\t\t\t// we re-add it here to conform with\r\n\t\t\t\t\t// computePropertyValue's behavior.\r\n\t\t\t\t\tcomputedValue = element.getBoundingClientRect[property] + \"px\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t// Deliberate fallthrough!\r\n\t\t\tdefault:\r\n\t\t\t\tcomputedValue = \"0px\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn computedValue ? String(computedValue) : \"\";\r\n}\r\n\r\n/**\r\n * Get a property value. This will grab via the cache if it exists, then\r\n * via any normalisations.\r\n */\r\nexport function getPropertyValue(element: HTMLorSVGElement, propertyName: string, fn?: VelocityNormalizationsFn, skipCache?: boolean): string {\r\n\tconst data = Data(element);\r\n\tlet propertyValue: string;\r\n\r\n\tif (NoCacheNormalizations.has(propertyName)) {\r\n\t\tskipCache = true;\r\n\t}\r\n\tif (!skipCache && data && data.cache[propertyName] != null) {\r\n\t\tpropertyValue = data.cache[propertyName];\r\n\t} else {\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tpropertyValue = fn(element);\r\n\t\t\tif (data) {\r\n\t\t\t\tdata.cache[propertyName] = propertyValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (Velocity.debug >= 2) {\r\n\t\tconsole.info(`Get \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t}\r\n\r\n\treturn propertyValue;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tweens\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, Sequence,\r\n\tVelocityProperty, VelocityPropertyFn, VelocityPropertyValueFn, VelocityTween,\r\n} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isNumber, isString} from \"../types\";\r\nimport {cloneArray, getValue} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {fixColors} from \"./css/fixColors\";\r\nimport {getPropertyValue} from \"./css/getPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {getNormalization, getNormalizationUnit} from \"./normalizations/normalizations\";\r\nimport {validateEasing} from \"./options\";\r\nimport {State} from \"./state\";\r\n\r\n// Constants\r\nconst rxHex = /^#([A-f\\d]{3}){1,2}$/i,\r\n\tcommands: {\r\n\t\t[type: string]: (\r\n\t\t\tvalue: any,\r\n\t\t\telement: HTMLorSVGElement,\r\n\t\t\telements: HTMLorSVGElement[],\r\n\t\t\telementArrayIndex: number,\r\n\t\t\tpropertyName: string,\r\n\t\t\ttween: VelocityTween) => string;\r\n\t} = {\r\n\t\t\tfunction: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn (value as any as VelocityPropertyValueFn).call(element, elementArrayIndex, elements.length);\r\n\t\t\t},\r\n\t\t\tnumber: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn String(value) + getNormalizationUnit(tween.fn);\r\n\t\t\t},\r\n\t\t\tstring: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(value);\r\n\t\t\t},\r\n\t\t\tundefined: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(getPropertyValue(element, propertyName, tween.fn) || \"\");\r\n\t\t\t},\r\n\t\t};\r\n\r\n/**\r\n * Expand a VelocityProperty argument into a valid sparse Tween array. This\r\n * pre-allocates the array as it is then the correct size and slightly\r\n * faster to access.\r\n */\r\nexport function expandProperties(animation: AnimationCall, properties: Properties) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telements = animation.elements,\r\n\t\telement = animation.element,\r\n\t\telementArrayIndex = elements.indexOf(element),\r\n\t\tdata = Data(element),\r\n\t\tqueue = getValue(animation.queue, animation.options.queue),\r\n\t\tduration = getValue(animation.options.duration, defaults.duration);\r\n\r\n\tfor (const property in properties) {\r\n\t\tif (properties.hasOwnProperty(property)) {\r\n\t\t\tconst propertyName = camelCase(property),\r\n\t\t\t\tfn = getNormalization(element, propertyName);\r\n\t\t\tlet valueData = properties[property];\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (valueData == null) {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to no value supplied.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst tween: VelocityTween = tweens[propertyName] = {} as any;\r\n\t\t\tlet endValue: string,\r\n\t\t\t\tstartValue: string;\r\n\r\n\t\t\ttween.fn = fn;\r\n\t\t\tif (isFunction(valueData)) {\r\n\t\t\t\t// If we have a function as the main argument then resolve\r\n\t\t\t\t// it first, in case it returns an array that needs to be\r\n\t\t\t\t// split.\r\n\t\t\t\tvalueData = (valueData as VelocityPropertyFn).call(element, elementArrayIndex, elements.length, elements);\r\n\t\t\t}\r\n\t\t\tif (Array.isArray(valueData)) {\r\n\t\t\t\t// valueData is an array in the form of\r\n\t\t\t\t// [ endValue, [, easing] [, startValue] ]\r\n\t\t\t\tconst arr1 = valueData[1],\r\n\t\t\t\t\tarr2 = valueData[2];\r\n\r\n\t\t\t\tendValue = valueData[0] as any;\r\n\t\t\t\tif ((isString(arr1) && (/^[\\d-]/.test(arr1) || rxHex.test(arr1))) || isFunction(arr1) || isNumber(arr1)) {\r\n\t\t\t\t\tstartValue = arr1 as any;\r\n\t\t\t\t} else if ((isString(arr1) && Easings[arr1]) || Array.isArray(arr1)) {\r\n\t\t\t\t\ttween.easing = validateEasing(arr1, duration);\r\n\t\t\t\t\tstartValue = arr2 as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstartValue = arr1 || arr2 as any;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tendValue = valueData as any;\r\n\t\t\t}\r\n\t\t\ttween.end = commands[typeof endValue](endValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\tif (startValue != null || (queue === false || data.queueList[queue] === undefined)) {\r\n\t\t\t\ttween.start = commands[typeof startValue](startValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// TODO: Needs a better match for \"translate3d\" etc - a number must be preceded by some form of break...\r\nconst rxToken = /((?:[+\\-*/]=)?(?:[+-]?\\d*\\.\\d+|[+-]?\\d+)[a-z%]*|(?:.(?!$|[+-]?\\d|[+\\-*/]=[+-]?\\d))+.|.)/g,\r\n\trxNumber = /^([+\\-*/]=)?([+-]?\\d*\\.\\d+|[+-]?\\d+)(.*)$/;\r\n\r\n/**\r\n * Find a pattern between multiple strings, return a VelocitySequence with\r\n * the pattern and the tokenised values.\r\n *\r\n * If number then animate.\r\n * If a string then must match.\r\n * If units then convert between them by wrapping in a calc().\r\n * - If already in a calc then nest another layer.\r\n * If in an rgba() then the first three numbers are rounded.\r\n */\r\nexport function findPattern(parts: ReadonlyArray, propertyName: string): Sequence {\r\n\tconst partsLength = parts.length,\r\n\t\ttokens: string[][] = [],\r\n\t\tindexes: number[] = [];\r\n\tlet numbers: boolean;\r\n\r\n\t// First tokenise the strings - these have all values, we will pull\r\n\t// numbers later.\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tif (isString(parts[part])) {\r\n\t\t\ttokens[part] = cloneArray(parts[part].match(rxToken));\r\n\t\t\tindexes[part] = 0;\r\n\t\t\t// If it matches more than one thing then we've got a number.\r\n\t\t\tnumbers = numbers || tokens[part].length > 1;\r\n\t\t\t//console.log(`tokens:`, parts[part], tokens[part])\r\n\t\t} else {\r\n\t\t\t// We have an incomplete lineup, it will get tried again later...\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tconst sequence: Sequence = [] as any,\r\n\t\tpattern = (sequence.pattern = []) as (string | boolean)[],\r\n\t\taddString = (text: string) => {\r\n\t\t\tif (isString(pattern[pattern.length - 1])) {\r\n\t\t\t\tpattern[pattern.length - 1] += text;\r\n\t\t\t} else if (text) {\r\n\t\t\t\tpattern.push(text);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\treturnStringType = () => {\r\n\t\t\tif (numbers || pattern.length > 1) {\r\n\t\t\t\t//console.error(`Velocity: Trying to pattern match mis-matched strings \"${propertyName}\":`, parts);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst isDisplay = propertyName === \"display\",\r\n\t\t\t\tisVisibility = propertyName === \"visibility\";\r\n\r\n\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\tconst value = parts[part];\r\n\r\n\t\t\t\tsequence[part][0] = value;\r\n\t\t\t\t// Don't care about duration...\r\n\t\t\t\tsequence[part].easing = validateEasing((isDisplay && value === \"none\") || (isVisibility && value === \"hidden\") || (!isDisplay && !isVisibility) ? \"at-end\" : \"at-start\", 400);\r\n\t\t\t}\r\n\t\t\tpattern[0] = false;\r\n\r\n\t\t\treturn sequence;\r\n\t\t};\r\n\tlet more = true;\r\n\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tsequence[part] = [];\r\n\t}\r\n\twhile (more) {\r\n\t\tconst bits: ([number, string] | [number, string, boolean])[] = [],\r\n\t\t\tunits: string[] = [];\r\n\t\tlet text: string,\r\n\t\t\tisUnitless = false,\r\n\t\t\thasNumbers = false;\r\n\r\n\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\tconst index = indexes[part]++,\r\n\t\t\t\ttoken = tokens[part][index];\r\n\r\n\t\t\tif (token) {\r\n\t\t\t\tconst num = token.match(rxNumber); // [ignore, change, number, unit]\r\n\r\n\t\t\t\tif (num) {\r\n\t\t\t\t\t// It's a number, possibly with a += change and unit.\r\n\t\t\t\t\tif (text) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst digits = parseFloat(num[2]),\r\n\t\t\t\t\t\tunit = num[3],\r\n\t\t\t\t\t\tchange = num[1] ? num[1][0] + unit : undefined,\r\n\t\t\t\t\t\tchangeOrUnit = change || unit;\r\n\r\n\t\t\t\t\tif (!units.includes(changeOrUnit)) {\r\n\t\t\t\t\t\t// Will be an empty string at the least.\r\n\t\t\t\t\t\tunits.push(changeOrUnit);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!unit) {\r\n\t\t\t\t\t\tif (digits) {\r\n\t\t\t\t\t\t\thasNumbers = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tisUnitless = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbits[part] = change ? [digits, changeOrUnit, true] : [digits, changeOrUnit];\r\n\t\t\t\t} else if (bits.length) {\r\n\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// It's a string.\r\n\t\t\t\t\tif (!text) {\r\n\t\t\t\t\t\ttext = token;\r\n\t\t\t\t\t} else if (text !== token) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!part) {\r\n\t\t\t\tfor (; part < partsLength; part++) {\r\n\t\t\t\t\tconst index2 = indexes[part]++;\r\n\r\n\t\t\t\t\tif (tokens[part][index2]) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// IMPORTANT: This is the exit point.\r\n\t\t\t\tmore = false;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t// Different\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (text) {\r\n\t\t\taddString(text);\r\n\t\t} else if (units.length) {\r\n\t\t\tif (units.length === 2 && isUnitless && !hasNumbers) {\r\n\t\t\t\t// If we only have two units, and one is empty, and it's only empty on \"0\", then treat us as having one unit\r\n\t\t\t\tunits.splice(units[0] ? 1 : 0, 1);\r\n\t\t\t}\r\n\t\t\tif (units.length === 1) {\r\n\t\t\t\t// All the same units, so append number then unit.\r\n\t\t\t\tconst unit = units[0],\r\n\t\t\t\t\tfirstLetter = unit[0];\r\n\r\n\t\t\t\tswitch (firstLetter) {\r\n\t\t\t\t\tcase \"+\":\r\n\t\t\t\t\tcase \"-\":\r\n\t\t\t\t\tcase \"*\":\r\n\t\t\t\t\tcase \"/\":\r\n\t\t\t\t\t\tif (propertyName) {\r\n\t\t\t\t\t\t\tconsole.error(`Velocity: The first property must not contain a relative function \"${propertyName}\":`, parts);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tpattern.push(false);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(bits[part][0]);\r\n\t\t\t\t}\r\n\t\t\t\taddString(unit);\r\n\t\t\t} else {\r\n\t\t\t\t// Multiple units, so must be inside a calc.\r\n\t\t\t\taddString(\"calc(\");\r\n\t\t\t\tconst patternCalc = pattern.length - 1; // Store the beginning of our calc.\r\n\r\n\t\t\t\tfor (let i = 0; i < units.length; i++) {\r\n\t\t\t\t\tconst unit = units[i],\r\n\t\t\t\t\t\tfirstLetter = unit[0],\r\n\t\t\t\t\t\tisComplex = firstLetter === \"*\" || firstLetter === \"/\",\r\n\t\t\t\t\t\tisMaths = isComplex || firstLetter === \"+\" || firstLetter === \"-\";\r\n\r\n\t\t\t\t\tif (isComplex) {\r\n\t\t\t\t\t\t// TODO: Not sure this should be done automatically!\r\n\t\t\t\t\t\tpattern[patternCalc] += \"(\";\r\n\t\t\t\t\t\taddString(\")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i) {\r\n\t\t\t\t\t\taddString(` ${isMaths ? firstLetter : \"+\"} `);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpattern.push(false);\r\n\t\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t\tconst bit = bits[part],\r\n\t\t\t\t\t\t\tvalue = bit[1] === unit\r\n\t\t\t\t\t\t\t\t? bit[0]\r\n\t\t\t\t\t\t\t\t: bit.length === 3\r\n\t\t\t\t\t\t\t\t\t? sequence[part - 1][sequence[part - 1].length - 1]\r\n\t\t\t\t\t\t\t\t\t: isComplex ? 1 : 0;\r\n\r\n\t\t\t\t\t\t(sequence[part] as any[]).push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\taddString(isMaths ? unit.substring(1) : unit);\r\n\t\t\t\t}\r\n\t\t\t\taddString(\")\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// We've got here, so a valid sequence - now check and fix RGB rounding\r\n\t// and calc() nesting...\r\n\t// TODO: Nested calc(a + calc(b + c)) -> calc(a + (b + c))\r\n\tfor (let i = 0, inRGB = 0; i < pattern.length; i++) {\r\n\t\tconst text = pattern[i];\r\n\r\n\t\tif (isString(text)) {\r\n\t\t\tif (inRGB && (text as string).indexOf(\",\") >= 0) {\r\n\t\t\t\tinRGB++;\r\n\t\t\t} else if ((text as string).indexOf(\"rgb\") >= 0) {\r\n\t\t\t\tinRGB = 1;\r\n\t\t\t}\r\n\t\t} else if (inRGB) {\r\n\t\t\tif (inRGB < 4) {\r\n\t\t\t\tpattern[i] = true;\r\n\t\t\t} else {\r\n\t\t\t\tinRGB = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn sequence;\r\n}\r\n\r\n/**\r\n * Convert a string-based tween with start and end strings, into a pattern\r\n * based tween with arrays.\r\n */\r\nfunction explodeTween(propertyName: string, tween: VelocityTween, duration: number, starting?: boolean) {\r\n\tconst startValue: string = tween.start,\r\n\t\tendValue: string = tween.end;\r\n\r\n\tif (!isString(endValue) || !isString(startValue)) {\r\n\t\treturn;\r\n\t}\r\n\tlet sequence: Sequence = findPattern([startValue, endValue], propertyName);\r\n\r\n\tif (!sequence && starting) {\r\n\t\t// This little piece will take a startValue, split out the\r\n\t\t// various numbers in it, then copy the endValue into the\r\n\t\t// startValue while replacing the numbers in it to match the\r\n\t\t// original start numbers as a repeating sequence.\r\n\t\t// Finally this function will run again with the new\r\n\t\t// startValue and a now matching pattern.\r\n\t\tconst startNumbers = startValue.match(/\\d\\.?\\d*/g) || [\"0\"],\r\n\t\t\tcount = startNumbers.length;\r\n\t\tlet index = 0;\r\n\r\n\t\tsequence = findPattern([endValue.replace(/\\d+\\.?\\d*/g, () => {\r\n\t\t\treturn startNumbers[index++ % count];\r\n\t\t}), endValue], propertyName);\r\n\t}\r\n\tif (sequence) {\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`Velocity: Sequence found:`, sequence);\r\n\t\t}\r\n\t\tsequence[0].percent = 0;\r\n\t\tsequence[1].percent = 1;\r\n\t\ttween.sequence = sequence;\r\n\t\tswitch (tween.easing) {\r\n\t\t\tcase Easings[\"at-start\"]:\r\n\t\t\tcase Easings[\"during\"]:\r\n\t\t\tcase Easings[\"at-end\"]:\r\n\t\t\t\tsequence[0].easing = sequence[1].easing = tween.easing;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Expand all queued animations that haven't gone yet\r\n *\r\n * This will automatically expand the properties map for any recently added\r\n * animations so that the start and end values are correct.\r\n */\r\nexport function validateTweens(activeCall: AnimationCall) {\r\n\t// This might be called on an already-ready animation\r\n\tif (State.firstNew === activeCall) {\r\n\t\tState.firstNew = activeCall._next;\r\n\t}\r\n\t// Check if we're actually already ready\r\n\tif (activeCall._flags & AnimationFlags.EXPANDED) { // tslint:disable-line:no-bitwise\r\n\t\treturn;\r\n\t}\r\n\tconst element = activeCall.element,\r\n\t\ttweens = activeCall.tweens,\r\n\t\tduration = getValue(activeCall.options.duration, defaults.duration);\r\n\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const propertyName in tweens) {\r\n\t\tconst tween = tweens[propertyName];\r\n\r\n\t\tif (tween.start == null) {\r\n\t\t\t// Get the start value as it's not been passed in\r\n\t\t\tconst startValue = getPropertyValue(activeCall.element, propertyName);\r\n\r\n\t\t\tif (isString(startValue)) {\r\n\t\t\t\ttween.start = fixColors(startValue) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration, true);\r\n\t\t\t} else if (!Array.isArray(startValue)) {\r\n\t\t\t\tconsole.warn(`bad type`, tween, propertyName, startValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`tweensContainer \"${propertyName}\": ${JSON.stringify(tween)}`, element);\r\n\t\t}\r\n\t}\r\n\tactiveCall._flags |= AnimationFlags.EXPANDED; // tslint:disable-line:no-bitwise\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tick\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, TweenStep, VelocityCallback, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {now} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {completeCall} from \"./complete\";\r\nimport {setPropertyValue} from \"./css/setPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {linearEasing} from \"./easing/easings\";\r\nimport {freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\nimport {validateTweens} from \"./tweens\";\r\n\r\n/**\r\n * Call the begin method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nexport function callBegin(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.begin as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Call the progress method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callProgress(activeCall: AnimationCall, timeCurrent: number) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements,\r\n\t\t\tpercentComplete = activeCall.percentComplete,\r\n\t\t\toptions = activeCall.options,\r\n\t\t\ttweenValue = activeCall.tween;\r\n\r\n\t\t(activeCall.options.progress as VelocityProgress).call(elements,\r\n\t\t\telements,\r\n\t\t\tpercentComplete,\r\n\t\t\tMath.max(0, activeCall.timeStart + (activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaults.duration) - timeCurrent),\r\n\t\t\ttweenValue !== undefined ? tweenValue : String(percentComplete * 100),\r\n\t\t\tactiveCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\nfunction asyncCallbacks() {\r\n\tlet activeCall: AnimationCall,\r\n\t\tnextCall: AnimationCall;\r\n\t// Callbacks and complete that might read the DOM again.\r\n\r\n\t// Progress callback\r\n\tfor (activeCall = firstProgress; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextProgress;\r\n\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\tcallProgress(activeCall, lastTick);\r\n\t}\r\n\t// Complete animations, including complete callback or looping\r\n\tfor (activeCall = firstComplete; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextComplete;\r\n\t\t/* If this call has finished tweening, pass it to complete() to handle call cleanup. */\r\n\t\tcompleteCall(activeCall);\r\n\t}\r\n}\r\n\r\n/**************\r\n Timing\r\n **************/\r\n\r\nconst FRAME_TIME = 1000 / 60,\r\n\t/**\r\n\t * Shim for window.performance in case it doesn't exist\r\n\t */\r\n\tperformance = (() => {\r\n\t\tconst perf = window.performance || {} as Performance;\r\n\r\n\t\tif (typeof perf.now !== \"function\") {\r\n\t\t\tconst nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : now();\r\n\r\n\t\t\tperf.now = () => {\r\n\t\t\t\treturn now() - nowOffset;\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn perf;\r\n\t})(),\r\n\t/**\r\n\t * Proxy function for when rAF is not available.\r\n\t *\r\n\t * This should hopefully never be used as the browsers often throttle\r\n\t * this to less than one frame per second in the background, making it\r\n\t * completely unusable.\r\n\t */\r\n\trAFProxy = (callback: FrameRequestCallback) => {\r\n\t\treturn setTimeout(callback, Math.max(0, FRAME_TIME - (performance.now() - lastTick)));\r\n\t},\r\n\t/**\r\n\t * Either requestAnimationFrame, or a shim for it.\r\n\t */\r\n\trAFShim = window.requestAnimationFrame || rAFProxy;\r\n\r\n/**\r\n * Set if we are currently inside a tick() to prevent double-calling.\r\n */\r\nlet ticking: boolean,\r\n\t/**\r\n\t * A background WebWorker that sends us framerate messages when we're in\r\n\t * the background. Without this we cannot maintain frame accuracy.\r\n\t */\r\n\tworker: Worker,\r\n\t/**\r\n\t * The first animation with a Progress callback.\r\n\t */\r\n\tfirstProgress: AnimationCall,\r\n\t/**\r\n\t * The first animation with a Complete callback.\r\n\t */\r\n\tfirstComplete: AnimationCall;\r\n\r\n/**\r\n * The time that the last animation frame ran at. Set from tick(), and used\r\n * for missing rAF (ie, when not in focus etc).\r\n */\r\nexport let lastTick: number = 0;\r\n\r\n/**\r\n * WebWorker background function.\r\n *\r\n * When we're in the background this will send us a msg every tick, when in\r\n * the foreground it won't.\r\n *\r\n * When running in the background the browser reduces allowed CPU etc, so\r\n * we raun at 30fps instead of 60fps.\r\n */\r\nfunction workerFn(this: Worker) {\r\n\tlet interval: any;\r\n\r\n\tthis.onmessage = (e) => {\r\n\t\tswitch (e.data) {\r\n\t\t\tcase true:\r\n\t\t\t\tif (!interval) {\r\n\t\t\t\t\tinterval = setInterval(() => {\r\n\t\t\t\t\t\tthis.postMessage(true);\r\n\t\t\t\t\t}, 1000 / 30);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase false:\r\n\t\t\t\tif (interval) {\r\n\t\t\t\t\tclearInterval(interval);\r\n\t\t\t\t\tinterval = 0;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthis.postMessage(e.data);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n}\r\n\r\ntry {\r\n\t// Create the worker - this might not be supported, hence the try/catch.\r\n\tworker = new Worker(URL.createObjectURL(new Blob([`(${workerFn})()`])));\r\n\t// Whenever the worker sends a message we tick()\r\n\tworker.onmessage = (e: MessageEvent) => {\r\n\t\tif (e.data === true) {\r\n\t\t\ttick();\r\n\t\t} else {\r\n\t\t\tasyncCallbacks();\r\n\t\t}\r\n\t};\r\n\t// And watch for going to the background to start the WebWorker running.\r\n\tif (!State.isMobile && document.hidden !== undefined) {\r\n\t\tdocument.addEventListener(\"visibilitychange\", () => {\r\n\t\t\tworker.postMessage(State.isTicking && document.hidden);\r\n\t\t});\r\n\t}\r\n} catch (e) {\r\n\t/*\r\n\t * WebWorkers are not supported in this format. This can happen in IE10\r\n\t * where it can't create one from a blob this way. We fallback, but make\r\n\t * no guarantees towards accuracy in this case.\r\n\t */\r\n}\r\n\r\n/**\r\n * Called on every tick, preferably through rAF. This is reponsible for\r\n * initialising any new animations, then starting any that need starting.\r\n * Finally it will expand any tweens and set the properties relating to\r\n * them. If there are any callbacks relating to the animations then they\r\n * will attempt to call at the end (with the exception of \"begin\").\r\n */\r\nexport function tick(timestamp?: number | boolean) {\r\n\tif (ticking) {\r\n\t\t// Should never happen - but if we've swapped back from hidden to\r\n\t\t// visibile then we want to make sure\r\n\t\treturn;\r\n\t}\r\n\tticking = true;\r\n\t/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\r\n\t We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\r\n\t the browser's next tick sync time occurs, which results in the first elements subjected to Velocity\r\n\t calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore\r\n\t the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated\r\n\t by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */\r\n\tif (timestamp !== false) {\r\n\t\tconst timeCurrent = performance.now(),\r\n\t\t\tdeltaTime = lastTick ? timeCurrent - lastTick : FRAME_TIME,\r\n\t\t\tdefaultSpeed = defaults.speed,\r\n\t\t\tdefaultEasing = defaults.easing,\r\n\t\t\tdefaultDuration = defaults.duration;\r\n\t\tlet activeCall: AnimationCall,\r\n\t\t\tnextCall: AnimationCall,\r\n\t\t\tlastProgress: AnimationCall,\r\n\t\t\tlastComplete: AnimationCall;\r\n\r\n\t\tfirstProgress = null;\r\n\t\tfirstComplete = null;\r\n\t\tif (deltaTime >= defaults.minFrameTime || !lastTick) {\r\n\t\t\tlastTick = timeCurrent;\r\n\r\n\t\t\t/********************\r\n\t\t\t Call Iteration\r\n\t\t\t ********************/\r\n\r\n\t\t\t// Expand any tweens that might need it.\r\n\t\t\twhile (State.firstNew) {\r\n\t\t\t\tvalidateTweens(State.firstNew);\r\n\t\t\t}\r\n\t\t\t// Iterate through each active call.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = activeCall._next) {\r\n\t\t\t\tconst element = activeCall.element,\r\n\t\t\t\t\tdata = Data(element);\r\n\r\n\t\t\t\t// Check to see if this element has been deleted midway\r\n\t\t\t\t// through the animation. If it's gone then end this\r\n\t\t\t\t// animation.\r\n\t\t\t\tif (!element.parentNode || !data) {\r\n\t\t\t\t\t// TODO: Remove safely - decrease count, delete data, remove from arrays\r\n\t\t\t\t\tfreeAnimationCall(activeCall);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tconst options = activeCall.options,\r\n\t\t\t\t\tflags = activeCall._flags;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// If this is the first time that this call has been\r\n\t\t\t\t// processed by tick() then we assign timeStart now so that\r\n\t\t\t\t// it's value is as close to the real animation start time\r\n\t\t\t\t// as possible.\r\n\t\t\t\tif (!timeStart) {\r\n\t\t\t\t\tconst queue = activeCall.queue != null ? activeCall.queue : options.queue;\r\n\r\n\t\t\t\t\ttimeStart = timeCurrent - deltaTime;\r\n\t\t\t\t\tif (queue !== false) {\r\n\t\t\t\t\t\ttimeStart = Math.max(timeStart, data.lastFinishList[queue] || 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall.timeStart = timeStart;\r\n\t\t\t\t}\r\n\t\t\t\t// If this animation is paused then skip processing unless\r\n\t\t\t\t// it has been set to resume.\r\n\t\t\t\tif (flags & AnimationFlags.PAUSED) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// Update the time start to accomodate the paused\r\n\t\t\t\t\t// completion amount.\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Check if this animation is ready - if it's synced then it\r\n\t\t\t\t// needs to wait for all other animations in the sync\r\n\t\t\t\tif (!(flags & AnimationFlags.READY)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.READY; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\toptions._ready++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Need to split the loop, as ready sync animations must all get\r\n\t\t\t// the same start time.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = nextCall) {\r\n\t\t\t\tconst flags = activeCall._flags;\r\n\r\n\t\t\t\tnextCall = activeCall._next;\r\n\t\t\t\tif (!(flags & AnimationFlags.READY) || (flags & AnimationFlags.PAUSED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst options = activeCall.options;\r\n\r\n\t\t\t\tif ((flags & AnimationFlags.SYNC) && options._ready < options._total) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst speed = activeCall.speed != null ? activeCall.speed : options.speed != null ? options.speed : defaultSpeed;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tif (!(flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tconst delay = activeCall.delay != null ? activeCall.delay : options.delay;\r\n\r\n\t\t\t\t\t// Make sure anything we've delayed doesn't start\r\n\t\t\t\t\t// animating yet, there might still be an active delay\r\n\t\t\t\t\t// after something has been un-paused\r\n\t\t\t\t\tif (delay) {\r\n\t\t\t\t\t\tif (timeStart + (delay / speed) > timeCurrent) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactiveCall.timeStart = timeStart += delay / (delay > 0 ? speed : 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// The begin callback is fired once per call, not once\r\n\t\t\t\t\t// per element, and is passed the full raw DOM element\r\n\t\t\t\t\t// set as both its context and its first argument.\r\n\t\t\t\t\tif (options._started++ === 0) {\r\n\t\t\t\t\t\toptions._first = activeCall;\r\n\t\t\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\t\t\tcallBegin(activeCall);\r\n\t\t\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (speed !== 1) {\r\n\t\t\t\t\t// On the first frame we may have a shorter delta\r\n\t\t\t\t\tconst delta = Math.min(deltaTime, timeCurrent - timeStart);\r\n\t\t\t\t\tactiveCall.timeStart = timeStart += delta * (1 - speed);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options._first === activeCall && options.progress) {\r\n\t\t\t\t\tactiveCall._nextProgress = undefined;\r\n\t\t\t\t\tif (lastProgress) {\r\n\t\t\t\t\t\tlastProgress._nextProgress = lastProgress = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstProgress = lastProgress = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst activeEasing = activeCall.easing != null ? activeCall.easing : options.easing != null ? options.easing : defaultEasing,\r\n\t\t\t\t\tmillisecondsEllapsed = activeCall.ellapsedTime = timeCurrent - timeStart,\r\n\t\t\t\t\tduration = activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaultDuration,\r\n\t\t\t\t\tpercentComplete = activeCall.percentComplete = Velocity.mock ? 1 : Math.min(millisecondsEllapsed / duration, 1),\r\n\t\t\t\t\ttweens = activeCall.tweens,\r\n\t\t\t\t\treverse = flags & AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\r\n\t\t\t\tif (percentComplete === 1) {\r\n\t\t\t\t\tactiveCall._nextComplete = undefined;\r\n\t\t\t\t\tif (lastComplete) {\r\n\t\t\t\t\t\tlastComplete._nextComplete = lastComplete = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstComplete = lastComplete = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const property in tweens) {\r\n\t\t\t\t\t// For every element, iterate through each property.\r\n\t\t\t\t\tconst tween = tweens[property],\r\n\t\t\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\t\t\tpattern = sequence.pattern;\r\n\t\t\t\t\tlet currentValue = \"\",\r\n\t\t\t\t\t\ti = 0;\r\n\r\n\t\t\t\t\tif (pattern) {\r\n\t\t\t\t\t\tconst easingComplete = (tween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\t\t\t\tlet best = 0;\r\n\r\n\t\t\t\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\t\t\t\tbest = j;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\t\t\t\teasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\t\t\t\tconst result = easing(reverse ? 1 - tweenPercent : tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(result) : result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (property !== \"tween\") {\r\n\t\t\t\t\t\t\tif (percentComplete === 1 && currentValue.startsWith(\"calc(0 + \")) {\r\n\t\t\t\t\t\t\t\tcurrentValue = currentValue.replace(/^calc\\(0[^\\d]* \\+ ([^\\(\\)]+)\\)$/, \"$1\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// TODO: To solve an IE<=8 positioning bug, the unit type must be dropped when setting a property value of 0 - add normalisations to legacy\r\n\t\t\t\t\t\t\tsetPropertyValue(activeCall.element, property, currentValue, tween.fn);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Skip the fake 'tween' property as that is only\r\n\t\t\t\t\t\t\t// passed into the progress callback.\r\n\t\t\t\t\t\t\tactiveCall.tween = currentValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Missing pattern:`, property, JSON.stringify(tween[property]));\r\n\t\t\t\t\t\tdelete tweens[property];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (firstProgress || firstComplete) {\r\n\t\t\t\tif (document.hidden) {\r\n\t\t\t\t\tasyncCallbacks();\r\n\t\t\t\t} else if (worker) {\r\n\t\t\t\t\tworker.postMessage(\"\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(asyncCallbacks, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (State.first) {\r\n\t\tState.isTicking = true;\r\n\t\tif (!document.hidden) {\r\n\t\t\trAFShim(tick);\r\n\t\t} else if (!worker) {\r\n\t\t\trAFProxy(tick);\r\n\t\t} else if (timestamp === false) {\r\n\t\t\t// Make sure we turn on the messages.\r\n\t\t\tworker.postMessage(true);\r\n\t\t}\r\n\t} else {\r\n\t\tState.isTicking = false;\r\n\t\tlastTick = 0;\r\n\t\tif (document.hidden && worker) {\r\n\t\t\t// Make sure we turn off the messages.\r\n\t\t\tworker.postMessage(false);\r\n\t\t}\r\n\t}\r\n\tticking = false;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Finish all animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {callBegin} from \"../tick\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be finished, and if so we set the tweens to\r\n * the final value for it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeFinished(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (!(animation._flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t// Copied from tick.ts - ensure that the animation is completely\r\n\t\t\t// valid and run begin() before complete().\r\n\t\t\tconst options = animation.options;\r\n\r\n\t\t\t// The begin callback is fired once per call, not once per\r\n\t\t\t// element, and is passed the full raw DOM element set as both\r\n\t\t\t// its context and its first argument.\r\n\t\t\tif (options._started++ === 0) {\r\n\t\t\t\toptions._first = animation;\r\n\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\tcallBegin(animation);\r\n\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tanimation._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\t// tslint:disable-next-line:forin\r\n\t\tfor (const property in animation.tweens) {\r\n\t\t\tconst tween = animation.tweens[property],\r\n\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\tpattern = sequence.pattern;\r\n\t\t\tlet currentValue = \"\",\r\n\t\t\t\ti = 0;\r\n\r\n\t\t\tif (pattern) {\r\n\t\t\t\tconst endValues = sequence[sequence.length - 1];\r\n\r\n\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\tconst endValue = endValues[i];\r\n\r\n\t\t\t\t\tcurrentValue += endValue == null ? pattern[i] : endValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetPropertyValue(animation.element, property, currentValue, tween.fn);\r\n\t\t}\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the finish action is triggered, the elements' currently active call is\r\n * immediately finished. When an element is finished, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are finished. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n */\r\nfunction finish(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeFinished(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeFinished(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"finish\", finish], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a value from one or more running animations.\r\n */\r\n\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateFpsLimit, validateLoop, validateQueue, validateRepeat,\r\n} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {lastTick} from \"../tick\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Used to map getters for the various AnimationFlags.\r\n */\r\nconst animationFlags: {[key: string]: number} = {\r\n\tisExpanded: AnimationFlags.EXPANDED,\r\n\tisReady: AnimationFlags.READY,\r\n\tisStarted: AnimationFlags.STARTED,\r\n\tisStopped: AnimationFlags.STOPPED,\r\n\tisPaused: AnimationFlags.PAUSED,\r\n\tisSync: AnimationFlags.SYNC,\r\n\tisReverse: AnimationFlags.REVERSE,\r\n};\r\n\r\n/**\r\n * Get or set an option or running AnimationCall data value. If there is no\r\n * value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n */\r\nfunction option(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst key = args[0],\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(queue, true);\r\n\tlet animations: AnimationCall[],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!key) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant key!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// If we're chaining the return value from Velocity then we are only\r\n\t// interested in the values related to that call\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tanimations = elements.velocity.animations;\r\n\t} else {\r\n\t\tanimations = [];\r\n\r\n\t\tfor (let activeCall = State.first; activeCall; activeCall = activeCall._next) {\r\n\t\t\tif (elements.indexOf(activeCall.element) >= 0 && getValue(activeCall.queue, activeCall.options.queue) === queueName) {\r\n\t\t\t\tanimations.push(activeCall);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we're dealing with multiple elements that are pointing at a\r\n\t\t// single running animation, then instead treat them as a single\r\n\t\t// animation.\r\n\t\tif (elements.length > 1 && animations.length > 1) {\r\n\t\t\tlet i = 1,\r\n\t\t\t\toptions = animations[0].options;\r\n\r\n\t\t\twhile (i < animations.length) {\r\n\t\t\t\tif (animations[i++].options !== options) {\r\n\t\t\t\t\toptions = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: this needs to check that they're actually a sync:true animation to merge the results, otherwise the individual values may be different\r\n\t\t\tif (options) {\r\n\t\t\t\tanimations = [animations[0]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// GET\r\n\tif (value === undefined) {\r\n\t\tconst result = [],\r\n\t\t\tflag = animationFlags[key];\r\n\r\n\t\tfor (const animation of animations) {\r\n\t\t\tif (flag === undefined) {\r\n\t\t\t\t// A normal key to get.\r\n\t\t\t\tresult.push(getValue(animation[key], animation.options[key]));\r\n\t\t\t} else {\r\n\t\t\t\t// A flag that we're checking against.\r\n\t\t\t\tresult.push((animation._flags & flag) === 0); // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (elements.length === 1 && animations.length === 1) {\r\n\t\t\t// If only a single animation is found and we're only targetting a\r\n\t\t\t// single element, then return the value directly\r\n\t\t\treturn result[0];\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tlet isPercentComplete: boolean;\r\n\r\n\tswitch (key) {\r\n\t\tcase \"cache\":\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tbreak;\r\n\t\tcase \"begin\":\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tbreak;\r\n\t\tcase \"complete\":\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tbreak;\r\n\t\tcase \"delay\":\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tbreak;\r\n\t\tcase \"duration\":\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tbreak;\r\n\t\tcase \"fpsLimit\":\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tbreak;\r\n\t\tcase \"loop\":\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tbreak;\r\n\t\tcase \"percentComplete\":\r\n\t\t\tisPercentComplete = true;\r\n\t\t\tvalue = parseFloat(value);\r\n\t\t\tbreak;\r\n\t\tcase \"repeat\":\r\n\t\tcase \"repeatAgain\":\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tif (key[0] !== \"_\") {\r\n\t\t\t\tconst num = parseFloat(value);\r\n\r\n\t\t\t\tif (value === String(num)) {\r\n\t\t\t\t\tvalue = num;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t// deliberate fallthrough\r\n\t\tcase \"queue\":\r\n\t\tcase \"promise\":\r\n\t\tcase \"promiseRejectEmpty\":\r\n\t\tcase \"easing\":\r\n\t\tcase \"started\":\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set a read-only key:`, key);\r\n\r\n\t\t\treturn;\r\n\t}\r\n\tif (value === undefined || value !== value) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set an invalid value:${key}=${value} (${args[1]})`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\tfor (const animation of animations) {\r\n\t\tif (isPercentComplete) {\r\n\t\t\tanimation.timeStart = lastTick - (getValue(animation.duration, animation.options.duration, defaults.duration) * value);\r\n\t\t} else {\r\n\t\t\tanimation[key] = value;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"option\", option], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Pause and resume animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be paused / resumed.\r\n */\r\nfunction checkAnimation(animation: AnimationCall, queueName: false | string, defaultQueue: false | string, isPaused: boolean) {\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (isPaused) {\r\n\t\t\tanimation._flags |= AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t} else {\r\n\t\t\tanimation._flags &= ~AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Pause and Resume are call-wide (not on a per element basis). Thus, calling pause or resume on a\r\n * single element will cause any calls that contain tweens for that element to be paused/resumed\r\n * as well.\r\n */\r\nfunction pauseResume(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string) {\r\n\tconst isPaused = action.indexOf(\"pause\") === 0,\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(args[0]),\r\n\t\tdefaultQueue = defaults.queue;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimation(animation, queueName, defaultQueue, isPaused);\r\n\t\t}\r\n\t} else {\r\n\t\tlet activeCall: AnimationCall = State.first;\r\n\r\n\t\twhile (activeCall) {\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimation(activeCall, queueName, defaultQueue, isPaused);\r\n\t\t\t}\r\n\t\t\tactiveCall = activeCall._next;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"pause\", pauseResume], true);\r\nregisterAction([\"resume\", pauseResume], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerAction} from \"./actions\";\r\n\r\nregisterAction([\"reverse\", (args?: any[], elements?: HTMLorSVGElement[] | VelocityResult, promiseHandler?: VelocityPromise, action?: string) => {\r\n\t// NOTE: Code needs to split out before here - but this is needed to prevent it being overridden\r\n\tthrow new SyntaxError(\"VelocityJS: The 'reverse' action is built in and private.\");\r\n}], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Stop animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be stopped, and if so then set the STOPPED\r\n * flag on it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeStopped(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tanimation._flags |= AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the stop action is triggered, the elements' currently active call is\r\n * immediately stopped. When an element is stopped, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are stopped. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n *\r\n * Note: The stop command runs prior to Velocity's Queueing phase since its\r\n * behavior is intended to take effect *immediately*, regardless of the\r\n * element's current queue state.\r\n */\r\nfunction stop(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise, action?: string): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeStopped(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeStopped(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"stop\", stop], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString, isVelocityResult} from \"../../types\";\r\nimport {fixColors} from \"../css/fixColors\";\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function style(elements: VelocityResult, property: {[property: string]: string}): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string): string | string[];\r\nexport function style(elements: VelocityResult, property: string, value: string): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string | {[property: string]: string}, value?: string) {\r\n\treturn styleAction([property, value], elements);\r\n}\r\n\r\n/**\r\n * Get or set a style of Nomralised property value on one or more elements.\r\n * If there is no value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n *\r\n * This can fail to set, and will reject the Promise if it does so.\r\n *\r\n * Velocity(elements, \"style\", \"property\", \"value\") => elements;\r\n * Velocity(elements, \"style\", {\"property\": \"value\", ...}) => elements;\r\n * Velocity(element, \"style\", \"property\") => \"value\";\r\n * Velocity(elements, \"style\", \"property\") => [\"value\", ...];\r\n */\r\nfunction styleAction(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst property = args[0],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!property) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant property!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// GET\r\n\tif (value === undefined && !isPlainObject(property)) {\r\n\t\t// If only a single animation is found and we're only targetting a\r\n\t\t// single element, then return the value directly\r\n\t\tif (elements.length === 1) {\r\n\t\t\treturn fixColors(getPropertyValue(elements[0], property));\r\n\t\t}\r\n\t\tconst result = [];\r\n\r\n\t\tfor (const element of elements) {\r\n\t\t\tresult.push(fixColors(getPropertyValue(element, property)));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tconst error: string[] = [];\r\n\r\n\tif (isPlainObject(property)) {\r\n\t\tfor (const propertyName in property) {\r\n\t\t\tif (property.hasOwnProperty(propertyName)) {\r\n\t\t\t\tfor (const element of elements) {\r\n\t\t\t\t\tconst propertyValue = property[propertyName];\r\n\r\n\t\t\t\t\tif (isString(propertyValue) || isNumber(propertyValue)) {\r\n\t\t\t\t\t\tsetPropertyValue(element, propertyName, property[propertyName]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\terror.push(`Cannot set a property \"${propertyName}\" to an unknown type: ${typeof propertyValue}`);\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Cannot set a property \"${propertyName}\" to an unknown type:`, propertyValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(value) || isNumber(value)) {\r\n\t\tfor (const element of elements) {\r\n\t\t\tsetPropertyValue(element, property, String(value));\r\n\t\t}\r\n\t} else {\r\n\t\terror.push(`Cannot set a property \"${property}\" to an unknown type: ${typeof value}`);\r\n\t\tconsole.warn(`VelocityJS: Cannot set a property \"${property}\" to an unknown type:`, value);\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (error.length) {\r\n\t\t\tpromiseHandler._rejecter(error.join(\", \"));\r\n\t\t} else if (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"style\", styleAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, HTMLorSVGElement, Properties, Sequence, SequenceList,\r\n\tTweenStep, VelocityEasingType, VelocityPromise, VelocityProperty,\r\n} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {linearEasing} from \"../easing/easings\";\r\nimport {validateEasing} from \"../options\";\r\nimport {expandSequence} from \"../sequences\";\r\nimport {SequencesObject} from \"../sequencesObject\";\r\nimport {expandProperties} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../../constants\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, properties: Properties, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, propertyName: string, property: VelocityProperty, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], ...args: any[]) {\r\n\treturn tweenAction(arguments as any, elements);\r\n}\r\n\r\n/**\r\n *\r\n */\r\nfunction tweenAction(args?: any[], elements?: HTMLorSVGElement[], promiseHandler?: VelocityPromise, action?: string): any {\r\n\tlet requireForcefeeding: boolean;\r\n\r\n\tif (!elements) {\r\n\t\tif (!args.length) {\r\n\t\t\tconsole.info(`Velocity(, \\\"tween\\\", percentComplete, property, end | [end, , ], ) => value\r\nVelocity(, \\\"tween\\\", percentComplete, {property: end | [end, , ], ...}, ) => {property: value, ...}`);\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\telements = [document.body];\r\n\t\trequireForcefeeding = true;\r\n\t} else if (elements.length !== 1) {\r\n\t\t// TODO: Allow more than a single element to return an array of results\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween more than one element!\");\r\n\t}\r\n\tconst percentComplete: number = args[0],\r\n\t\tfakeAnimation = {\r\n\t\t\telements,\r\n\t\t\telement: elements[0],\r\n\t\t\tqueue: false,\r\n\t\t\toptions: {\r\n\t\t\t\tduration: 1000,\r\n\t\t\t},\r\n\t\t\ttweens: null as {[property: string]: Sequence},\r\n\t\t} as any as AnimationCall,\r\n\t\tresult: {[property: string]: string} = {};\r\n\tlet properties: Properties = args[1],\r\n\t\tsingleResult: boolean,\r\n\t\tmaybeSequence: SequenceList,\r\n\t\teasing: VelocityEasingType = args[2],\r\n\t\tcount = 0;\r\n\r\n\tif (isString(args[1])) {\r\n\t\tif (SequencesObject && SequencesObject[args[1]]) {\r\n\t\t\tmaybeSequence = SequencesObject[args[1]];\r\n\t\t\tproperties = {};\r\n\t\t\teasing = args[2];\r\n\t\t} else {\r\n\t\t\tsingleResult = true;\r\n\t\t\tproperties = {\r\n\t\t\t\t[args[1]]: args[2],\r\n\t\t\t};\r\n\t\t\teasing = args[3];\r\n\t\t}\r\n\t} else if (Array.isArray(args[1])) {\r\n\t\tsingleResult = true;\r\n\t\tproperties = {\r\n\t\t\ttween: args[1],\r\n\t\t} as any;\r\n\t\teasing = args[2];\r\n\t}\r\n\tif (!isNumber(percentComplete) || percentComplete < 0 || percentComplete > 1) {\r\n\t\tthrow new Error(\"VelocityJS: Must tween a percentage from 0 to 1!\");\r\n\t}\r\n\tif (!isPlainObject(properties)) {\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween an invalid property!\");\r\n\t}\r\n\tif (requireForcefeeding) {\r\n\t\tfor (const property in properties) {\r\n\t\t\tif (properties.hasOwnProperty(property) && (!Array.isArray(properties[property]) || properties[property].length < 2)) {\r\n\t\t\t\tthrow new Error(\"VelocityJS: When not supplying an element you must force-feed values: \" + property);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst activeEasing = validateEasing(getValue(easing, defaults.easing), DEFAULT_DURATION);\r\n\r\n\tif (maybeSequence) {\r\n\t\texpandSequence(fakeAnimation, maybeSequence);\r\n\t} else {\r\n\t\texpandProperties(fakeAnimation as AnimationCall, properties);\r\n\t}\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const property in fakeAnimation.tweens) {\r\n\t\t// For every element, iterate through each property.\r\n\t\tconst propertyTween = fakeAnimation.tweens[property],\r\n\t\t\tsequence = propertyTween.sequence,\r\n\t\t\tpattern = sequence.pattern;\r\n\t\tlet currentValue = \"\",\r\n\t\t\ti = 0;\r\n\r\n\t\tcount++;\r\n\t\tif (pattern) {\r\n\t\t\tconst easingComplete = (propertyTween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\tlet best = 0;\r\n\r\n\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\tbest = j;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\ttweenEasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\tconst value = tweenEasing(tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(value) : value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresult[property] = currentValue;\r\n\t\t}\r\n\t}\r\n\r\n\tif (singleResult && count === 1) {\r\n\t\tfor (const property in result) {\r\n\t\t\tif (result.hasOwnProperty(property)) {\r\n\t\t\t\treturn result[property];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nregisterAction([\"tween\", tweenAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {ColorNames} from \"./fixColors\";\r\n\r\n/**\r\n * Converting from hex as it makes for a smaller file.\r\n */\r\nconst colorValues = {\r\n\taliceblue: 0xF0F8FF,\r\n\tantiquewhite: 0xFAEBD7,\r\n\taqua: 0x00FFFF,\r\n\taquamarine: 0x7FFFD4,\r\n\tazure: 0xF0FFFF,\r\n\tbeige: 0xF5F5DC,\r\n\tbisque: 0xFFE4C4,\r\n\tblack: 0x000000,\r\n\tblanchedalmond: 0xFFEBCD,\r\n\tblue: 0x0000FF,\r\n\tblueviolet: 0x8A2BE2,\r\n\tbrown: 0xA52A2A,\r\n\tburlywood: 0xDEB887,\r\n\tcadetblue: 0x5F9EA0,\r\n\tchartreuse: 0x7FFF00,\r\n\tchocolate: 0xD2691E,\r\n\tcoral: 0xFF7F50,\r\n\tcornflowerblue: 0x6495ED,\r\n\tcornsilk: 0xFFF8DC,\r\n\tcrimson: 0xDC143C,\r\n\tcyan: 0x00FFFF,\r\n\tdarkblue: 0x00008B,\r\n\tdarkcyan: 0x008B8B,\r\n\tdarkgoldenrod: 0xB8860B,\r\n\tdarkgray: 0xA9A9A9,\r\n\tdarkgrey: 0xA9A9A9,\r\n\tdarkgreen: 0x006400,\r\n\tdarkkhaki: 0xBDB76B,\r\n\tdarkmagenta: 0x8B008B,\r\n\tdarkolivegreen: 0x556B2F,\r\n\tdarkorange: 0xFF8C00,\r\n\tdarkorchid: 0x9932CC,\r\n\tdarkred: 0x8B0000,\r\n\tdarksalmon: 0xE9967A,\r\n\tdarkseagreen: 0x8FBC8F,\r\n\tdarkslateblue: 0x483D8B,\r\n\tdarkslategray: 0x2F4F4F,\r\n\tdarkslategrey: 0x2F4F4F,\r\n\tdarkturquoise: 0x00CED1,\r\n\tdarkviolet: 0x9400D3,\r\n\tdeeppink: 0xFF1493,\r\n\tdeepskyblue: 0x00BFFF,\r\n\tdimgray: 0x696969,\r\n\tdimgrey: 0x696969,\r\n\tdodgerblue: 0x1E90FF,\r\n\tfirebrick: 0xB22222,\r\n\tfloralwhite: 0xFFFAF0,\r\n\tforestgreen: 0x228B22,\r\n\tfuchsia: 0xFF00FF,\r\n\tgainsboro: 0xDCDCDC,\r\n\tghostwhite: 0xF8F8FF,\r\n\tgold: 0xFFD700,\r\n\tgoldenrod: 0xDAA520,\r\n\tgray: 0x808080,\r\n\tgrey: 0x808080,\r\n\tgreen: 0x008000,\r\n\tgreenyellow: 0xADFF2F,\r\n\thoneydew: 0xF0FFF0,\r\n\thotpink: 0xFF69B4,\r\n\tindianred: 0xCD5C5C,\r\n\tindigo: 0x4B0082,\r\n\tivory: 0xFFFFF0,\r\n\tkhaki: 0xF0E68C,\r\n\tlavender: 0xE6E6FA,\r\n\tlavenderblush: 0xFFF0F5,\r\n\tlawngreen: 0x7CFC00,\r\n\tlemonchiffon: 0xFFFACD,\r\n\tlightblue: 0xADD8E6,\r\n\tlightcoral: 0xF08080,\r\n\tlightcyan: 0xE0FFFF,\r\n\tlightgoldenrodyellow: 0xFAFAD2,\r\n\tlightgray: 0xD3D3D3,\r\n\tlightgrey: 0xD3D3D3,\r\n\tlightgreen: 0x90EE90,\r\n\tlightpink: 0xFFB6C1,\r\n\tlightsalmon: 0xFFA07A,\r\n\tlightseagreen: 0x20B2AA,\r\n\tlightskyblue: 0x87CEFA,\r\n\tlightslategray: 0x778899,\r\n\tlightslategrey: 0x778899,\r\n\tlightsteelblue: 0xB0C4DE,\r\n\tlightyellow: 0xFFFFE0,\r\n\tlime: 0x00FF00,\r\n\tlimegreen: 0x32CD32,\r\n\tlinen: 0xFAF0E6,\r\n\tmagenta: 0xFF00FF,\r\n\tmaroon: 0x800000,\r\n\tmediumaquamarine: 0x66CDAA,\r\n\tmediumblue: 0x0000CD,\r\n\tmediumorchid: 0xBA55D3,\r\n\tmediumpurple: 0x9370DB,\r\n\tmediumseagreen: 0x3CB371,\r\n\tmediumslateblue: 0x7B68EE,\r\n\tmediumspringgreen: 0x00FA9A,\r\n\tmediumturquoise: 0x48D1CC,\r\n\tmediumvioletred: 0xC71585,\r\n\tmidnightblue: 0x191970,\r\n\tmintcream: 0xF5FFFA,\r\n\tmistyrose: 0xFFE4E1,\r\n\tmoccasin: 0xFFE4B5,\r\n\tnavajowhite: 0xFFDEAD,\r\n\tnavy: 0x000080,\r\n\toldlace: 0xFDF5E6,\r\n\tolive: 0x808000,\r\n\tolivedrab: 0x6B8E23,\r\n\torange: 0xFFA500,\r\n\torangered: 0xFF4500,\r\n\torchid: 0xDA70D6,\r\n\tpalegoldenrod: 0xEEE8AA,\r\n\tpalegreen: 0x98FB98,\r\n\tpaleturquoise: 0xAFEEEE,\r\n\tpalevioletred: 0xDB7093,\r\n\tpapayawhip: 0xFFEFD5,\r\n\tpeachpuff: 0xFFDAB9,\r\n\tperu: 0xCD853F,\r\n\tpink: 0xFFC0CB,\r\n\tplum: 0xDDA0DD,\r\n\tpowderblue: 0xB0E0E6,\r\n\tpurple: 0x800080,\r\n\trebeccapurple: 0x663399,\r\n\tred: 0xFF0000,\r\n\trosybrown: 0xBC8F8F,\r\n\troyalblue: 0x4169E1,\r\n\tsaddlebrown: 0x8B4513,\r\n\tsalmon: 0xFA8072,\r\n\tsandybrown: 0xF4A460,\r\n\tseagreen: 0x2E8B57,\r\n\tseashell: 0xFFF5EE,\r\n\tsienna: 0xA0522D,\r\n\tsilver: 0xC0C0C0,\r\n\tskyblue: 0x87CEEB,\r\n\tslateblue: 0x6A5ACD,\r\n\tslategray: 0x708090,\r\n\tslategrey: 0x708090,\r\n\tsnow: 0xFFFAFA,\r\n\tspringgreen: 0x00FF7F,\r\n\tsteelblue: 0x4682B4,\r\n\ttan: 0xD2B48C,\r\n\tteal: 0x008080,\r\n\tthistle: 0xD8BFD8,\r\n\ttomato: 0xFF6347,\r\n\tturquoise: 0x40E0D0,\r\n\tviolet: 0xEE82EE,\r\n\twheat: 0xF5DEB3,\r\n\twhite: 0xFFFFFF,\r\n\twhitesmoke: 0xF5F5F5,\r\n\tyellow: 0xFFFF00,\r\n\tyellowgreen: 0x9ACD32,\r\n};\r\n\r\nfor (const name in colorValues) {\r\n\tif (colorValues.hasOwnProperty(name)) {\r\n\t\tconst color = colorValues[name];\r\n\r\n\t\tColorNames[name] = `${Math.floor(color / 65536)},${Math.floor(color / 256 % 256)},${(color % 256)}`;\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Back easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nexport function registerBackIn(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackOut(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (Math.pow(--percentComplete, 2) * ((amount + 1) * percentComplete + amount) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackInOut(name: string, amount: number) {\r\n\tamount *= 1.525;\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tpercentComplete *= 2;\r\n\r\n\t\treturn (percentComplete < 1\r\n\t\t\t? (Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount))\r\n\t\t\t: (Math.pow(percentComplete - 2, 2) * ((amount + 1) * (percentComplete - 2) + amount) + 2)\r\n\t\t) * 0.5 * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterBackIn(\"easeInBack\", 1.7);\r\nregisterBackOut(\"easeOutBack\", 1.7);\r\nregisterBackInOut(\"easeInOutBack\", 1.7);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bounce easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nfunction easeOutBouncePercent(percentComplete: number): number {\r\n\tif (percentComplete < 1 / 2.75) {\r\n\t\treturn (7.5625 * percentComplete * percentComplete);\r\n\t}\r\n\tif (percentComplete < 2 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 1.5 / 2.75) * percentComplete + 0.75);\r\n\t}\r\n\tif (percentComplete < 2.5 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 2.25 / 2.75) * percentComplete + 0.9375);\r\n\t}\r\n\r\n\treturn (7.5625 * (percentComplete -= 2.625 / 2.75) * percentComplete + 0.984375);\r\n}\r\n\r\nfunction easeInBouncePercent(percentComplete: number): number {\r\n\treturn 1 - easeOutBouncePercent(1 - percentComplete);\r\n}\r\n\r\nexport function easeInBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeInBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeOutBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeInOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn (percentComplete < 0.5\r\n\t\t? easeInBouncePercent(percentComplete * 2) * 0.5\r\n\t\t: easeOutBouncePercent(percentComplete * 2 - 1) * 0.5 + 0.5\r\n\t) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"easeInBounce\", easeInBounce]);\r\nregisterEasing([\"easeOutBounce\", easeOutBounce]);\r\nregisterEasing([\"easeInOutBounce\", easeInOutBounce]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Elastic easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n// Constants\r\nconst PI2 = Math.PI * 2;\r\n\r\nexport function registerElasticIn(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn -(amplitude * Math.pow(2, 10 * (percentComplete -= 1)) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period)) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticInOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tconst s = period / PI2 * Math.asin(1 / amplitude);\r\n\r\n\t\tpercentComplete = percentComplete * 2 - 1;\r\n\r\n\t\treturn (percentComplete < 0\r\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period))\r\n\t\t\t: amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period) * 0.5 + 1\r\n\t\t) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterElasticIn(\"easeInElastic\", 1, 0.3);\r\nregisterElasticOut(\"easeOutElastic\", 1, 0.3);\r\nregisterElasticInOut(\"easeInOutElastic\", 1, 0.3 * 1.5);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Easings to act on strings, either set at the start or at the end depending on\r\n * need.\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Easing function that sets to the specified value immediately after the\r\n * animation starts.\r\n */\r\nexport function atStart(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value while the animation is\r\n * running.\r\n */\r\nexport function during(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0 || percentComplete === 1\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value when the animation ends.\r\n */\r\nexport function atEnd(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 1\r\n\t\t? endValue\r\n\t\t: startValue;\r\n}\r\n\r\nregisterEasing([\"at-start\", atStart]);\r\nregisterEasing([\"during\", during]);\r\nregisterEasing([\"at-end\", atEnd]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {augmentDimension} from \"../css/augmentDimension\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get/set the inner/outer dimension.\r\n */\r\nfunction getDimension(name: \"width\" | \"height\", wantInner: boolean) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn augmentDimension(element, name, wantInner) + \"px\";\r\n\t\t}\r\n\t\tsetPropertyValue(element, name, (parseFloat(propertyValue) - augmentDimension(element, name, wantInner)) + \"px\");\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"innerWidth\", getDimension(\"width\", true)]);\r\nregisterNormalization([\"Element\", \"innerHeight\", getDimension(\"height\", true)]);\r\nregisterNormalization([\"Element\", \"outerWidth\", getDimension(\"width\", false)]);\r\nregisterNormalization([\"Element\", \"outerHeight\", getDimension(\"height\", false)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {Data} from \"../data\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n// Constants\r\nexport const inlineRx = /^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|let|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i,\r\n\tlistItemRx = /^(li)$/i,\r\n\ttableRowRx = /^(tr)$/i,\r\n\ttableRx = /^(table)$/i,\r\n\ttableRowGroupRx = /^(tbody)$/i;\r\n\r\n/**\r\n * Display has an extra value of \"auto\" that works out the correct value\r\n * based on the type of element.\r\n */\r\nfunction display(element: HTMLorSVGElement): string;\r\nfunction display(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction display(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tconst style = element.style;\r\n\r\n\tif (propertyValue === undefined) {\r\n\t\treturn computePropertyValue(element, \"display\");\r\n\t}\r\n\tif (propertyValue === \"auto\") {\r\n\t\tconst nodeName = element && element.nodeName,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (inlineRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"inline\";\r\n\t\t} else if (listItemRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"list-item\";\r\n\t\t} else if (tableRowRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row\";\r\n\t\t} else if (tableRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table\";\r\n\t\t} else if (tableRowGroupRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row-group\";\r\n\t\t} else {\r\n\t\t\t// Default to \"block\" when no match is found.\r\n\t\t\tpropertyValue = \"block\";\r\n\t\t}\r\n\t\t// IMPORTANT: We need to do this as getPropertyValue bypasses the\r\n\t\t// Normalisation when it exists in the cache.\r\n\t\tdata.cache[\"display\"] = propertyValue;\r\n\t}\r\n\tstyle.display = propertyValue;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"display\", display]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction clientWidth(element: HTMLorSVGElement): string;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction scrollWidth(element: HTMLorSVGElement): string;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction clientHeight(element: HTMLorSVGElement): string;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction scrollHeight(element: HTMLorSVGElement): string;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Scroll an element.\r\n */\r\nfunction scroll(direction: \"Height\", end: \"Top\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Width\", end: \"Left\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Height\" | \"Width\", end: \"Top\" | \"Left\"): VelocityNormalizationsFn {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue == null) {\r\n\t\t\t// Make sure we have these values cached.\r\n\t\t\tgetPropertyValue(element, \"client\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + end, null, true);\r\n\r\n\t\t\treturn element[\"scroll\" + end] + \"px\";\r\n\t\t}\r\n\t\tconst value = parseFloat(propertyValue),\r\n\t\t\tunit = propertyValue.replace(String(value), \"\");\r\n\r\n\t\tswitch (unit) {\r\n\t\t\tcase \"\":\r\n\t\t\tcase \"px\":\r\n\t\t\t\telement[\"scroll\" + end] = value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"%\":\r\n\t\t\t\tconst client = parseFloat(getPropertyValue(element, \"client\" + direction)),\r\n\t\t\t\t\tscrollValue = parseFloat(getPropertyValue(element, \"scroll\" + direction));\r\n\r\n\t\t\t\telement[\"scroll\" + end] = Math.max(0, scrollValue - client) * value / 100;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"HTMLElement\", \"scroll\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollTop\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollLeft\", scroll(\"Width\", \"Left\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollWidth\", scrollWidth]);\r\nregisterNormalization([\"HTMLElement\", \"clientWidth\", clientWidth]);\r\nregisterNormalization([\"HTMLElement\", \"scrollHeight\", scrollHeight]);\r\nregisterNormalization([\"HTMLElement\", \"clientHeight\", clientHeight]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * This handles all CSS style properties. With browser prefixed properties it\r\n * will register a version that handles setting (and getting) both the prefixed\r\n * and non-prefixed version.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {ALL_VENDOR_PREFIXES} from \"../../constants\";\r\nimport {isString} from \"../../types\";\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {State} from \"../state\";\r\nimport {hasNormalization, registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * An RegExp pattern for the following list of css words using\r\n * http://kemio.com.ar/tools/lst-trie-re.php to generate:\r\n *\r\n * blockSize\r\n * borderBottomLeftRadius\r\n * borderBottomRightRadius\r\n * borderBottomWidth\r\n * borderImageOutset\r\n * borderImageWidth\r\n * borderLeftWidth\r\n * borderRadius\r\n * borderRightWidth\r\n * borderSpacing\r\n * borderTopLeftRadius\r\n * borderTopRightRadius\r\n * borderTopWidth\r\n * borderWidth\r\n * bottom\r\n * columnGap\r\n * columnRuleWidth\r\n * columnWidth\r\n * flexBasis\r\n * fontSize\r\n * gridColumnGap\r\n * gridGap\r\n * gridRowGap\r\n * height\r\n * inlineSize\r\n * left\r\n * letterSpacing\r\n * margin\r\n * marginBottom\r\n * marginLeft\r\n * marginRight\r\n * marginTop\r\n * maxBlockSize\r\n * maxHeight\r\n * maxInlineSize\r\n * maxWidth\r\n * minBlockSize\r\n * minHeight\r\n * minInlineSize\r\n * minWidth\r\n * objectPosition\r\n * outlineOffset\r\n * outlineWidth\r\n * padding\r\n * paddingBottom\r\n * paddingLeft\r\n * paddingRight\r\n * paddingTop\r\n * perspective\r\n * right\r\n * shapeMargin\r\n * strokeDashoffset\r\n * strokeWidth\r\n * textIndent\r\n * top\r\n * transformOrigin\r\n * width\r\n * wordSpacing\r\n */\r\n// tslint:disable-next-line:max-line-length\r\nconst rxAddPx = /^(b(lockSize|o(rder(Bottom(LeftRadius|RightRadius|Width)|Image(Outset|Width)|LeftWidth|R(adius|ightWidth)|Spacing|Top(LeftRadius|RightRadius|Width)|Width)|ttom))|column(Gap|RuleWidth|Width)|f(lexBasis|ontSize)|grid(ColumnGap|Gap|RowGap)|height|inlineSize|le(ft|tterSpacing)|m(a(rgin(Bottom|Left|Right|Top)|x(BlockSize|Height|InlineSize|Width))|in(BlockSize|Height|InlineSize|Width))|o(bjectPosition|utline(Offset|Width))|p(adding(Bottom|Left|Right|Top)|erspective)|right|s(hapeMargin|troke(Dashoffset|Width))|t(extIndent|op|ransformOrigin)|w(idth|ordSpacing))$/;\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a prefixed style\r\n * property.\r\n */\r\nfunction getSetPrefixed(propertyName: string, unprefixed: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName) || computePropertyValue(element, unprefixed);\r\n\t\t}\r\n\t\telement.style[propertyName] = element.style[unprefixed] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a style property.\r\n */\r\nfunction getSetStyle(propertyName: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName);\r\n\t\t}\r\n\t\telement.style[propertyName] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Vendor prefixes. Chrome / Safari, Firefox, IE / Edge, Opera.\r\n */\r\nconst rxVendors = /^(webkit|moz|ms|o)[A-Z]/,\r\n\tprefixElement = State.prefixElement;\r\n\r\nfor (const propertyName in prefixElement.style) {\r\n\tif (rxVendors.test(propertyName)) {\r\n\t\tconst unprefixed = propertyName.replace(/^[a-z]+([A-Z])/, ($, letter: string) => letter.toLowerCase());\r\n\r\n\t\tif (ALL_VENDOR_PREFIXES || isString(prefixElement.style[unprefixed])) {\r\n\t\t\tconst addUnit = rxAddPx.test(unprefixed) ? \"px\" : undefined;\r\n\r\n\t\t\tregisterNormalization([\"Element\", unprefixed, getSetPrefixed(propertyName, unprefixed), addUnit]);\r\n\t\t}\r\n\t} else if (!hasNormalization([\"Element\", propertyName])) {\r\n\t\tconst addUnit = rxAddPx.test(propertyName) ? \"px\" : undefined;\r\n\r\n\t\tregisterNormalization([\"Element\", propertyName, getSetStyle(propertyName), addUnit]);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../../types\";\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set an attribute.\r\n */\r\nfunction getAttribute(name: string) {\r\n\treturn ((element: Element, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn element.getAttribute(name);\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nconst base = document.createElement(\"div\"),\r\n\trxSubtype = /^SVG(.*)Element$/,\r\n\trxElement = /Element$/;\r\n\r\nObject.getOwnPropertyNames(window)\r\n\t.forEach((property) => {\r\n\t\tconst subtype = rxSubtype.exec(property);\r\n\r\n\t\tif (subtype && subtype[1] !== \"SVG\") { // Don't do SVGSVGElement.\r\n\t\t\ttry {\r\n\t\t\t\tconst element = subtype[1] ? document.createElementNS(\"http://www.w3.org/2000/svg\", (subtype[1] || \"svg\").toLowerCase()) : document.createElement(\"svg\");\r\n\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const attribute in element) {\r\n\t\t\t\t\t// Although this isn't a tween without prototypes, we do\r\n\t\t\t\t\t// want to get hold of all attributes and not just own ones.\r\n\t\t\t\t\tconst value = element[attribute];\r\n\r\n\t\t\t\t\tif (isString(attribute)\r\n\t\t\t\t\t\t&& !(attribute[0] === \"o\" && attribute[1] === \"n\")\r\n\t\t\t\t\t\t&& attribute !== attribute.toUpperCase()\r\n\t\t\t\t\t\t&& !rxElement.test(attribute)\r\n\t\t\t\t\t\t&& !(attribute in base)\r\n\t\t\t\t\t\t&& !isFunction(value)) {\r\n\t\t\t\t\t\t// TODO: Should this all be set on the generic SVGElement, it would save space and time, but not as powerful\r\n\t\t\t\t\t\tregisterNormalization([property, attribute, getAttribute(attribute)]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.error(`VelocityJS: Error when trying to identify SVG attributes on ${property}.`, e);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set the width or height.\r\n */\r\nfunction getDimension(name: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\t// Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM.\r\n\t\t\ttry {\r\n\t\t\t\treturn (element as SVGGraphicsElement).getBBox()[name] + \"px\";\r\n\t\t\t} catch (e) {\r\n\t\t\t\treturn \"0px\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"SVGElement\", \"width\", getDimension(\"width\")]);\r\nregisterNormalization([\"SVGElement\", \"height\", getDimension(\"height\")]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * A fake normalization used to allow the \"tween\" property easy access.\r\n */\r\nfunction getSetTween(element: HTMLorSVGElement, propertyValue?: string) {\r\n\tif (propertyValue === undefined) {\r\n\t\treturn \"\";\r\n\t}\r\n}\r\n\r\nregisterNormalization([\"Element\", \"tween\", getSetTween]);\r\n","/*\n * velocity-animate (C) 2014-2017 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Automatically generated\nexport const VERSION = \"2.0.3\";\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, SequenceList, VelocitySequence, VelocityTween} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../types\";\r\nimport Velocity from \"../velocity\";\r\nimport {registerAction} from \"./actions/actions\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {getNormalization} from \"./normalizations/normalizations\";\r\nimport {validateDuration, validateEasing} from \"./options\";\r\nimport {SequencesObject} from \"./sequencesObject\";\r\nimport {findPattern} from \"./tweens\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../constants\";\r\n\r\nconst rxPercents = /(\\d*\\.\\d+|\\d+\\.?|from|to)/g;\r\n\r\nexport function expandSequence(animation: AnimationCall, sequence: SequenceList) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telement = animation.element;\r\n\r\n\tfor (const propertyName in sequence.tweens) {\r\n\t\tif (sequence.tweens.hasOwnProperty(propertyName)) {\r\n\t\t\tconst fn = getNormalization(element, propertyName);\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping [${propertyName}] due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttweens[propertyName] = {\r\n\t\t\t\tfn,\r\n\t\t\t\tsequence: sequence.tweens[propertyName],\r\n\t\t\t} as VelocityTween;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to register a sequence. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerSequence\", \"\"name\", VelocitySequence);\r\n */\r\nexport function registerSequence(args?: [string, VelocitySequence] | [{[name: string]: VelocitySequence}]) {\r\n\tif (isPlainObject(args[0])) {\r\n\t\tfor (const name in (args[0] as {[name: string]: VelocitySequence})) {\r\n\t\t\tif (args[0].hasOwnProperty(name)) {\r\n\t\t\t\tregisterSequence([name, args[0][name]]);\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(args[0])) {\r\n\t\tconst name = args[0] as string,\r\n\t\t\tsequence = args[1] as VelocitySequence;\r\n\r\n\t\tif (!isString(name)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' name to an invalid value:`, name);\r\n\t\t} else if (!isPlainObject(sequence)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' sequence to an invalid value:`, name, sequence);\r\n\t\t} else {\r\n\t\t\tif (SequencesObject[name]) {\r\n\t\t\t\tconsole.warn(`VelocityJS: Replacing named sequence:`, name);\r\n\t\t\t}\r\n\t\t\tconst percents: {[key: string]: string[]} = {},\r\n\t\t\t\tsteps: string[] = new Array(100),\r\n\t\t\t\tproperties: string[] = [],\r\n\t\t\t\tpercentages: string[] = [],\r\n\t\t\t\tsequenceList: SequenceList = SequencesObject[name] = {} as any,\r\n\t\t\t\tduration = validateDuration((sequence as any).duration);\r\n\r\n\t\t\tsequenceList.tweens = {};\r\n\t\t\tif (isNumber(duration)) {\r\n\t\t\t\tsequenceList.duration = duration;\r\n\t\t\t}\r\n\t\t\tfor (const part in sequence) {\r\n\t\t\t\tif (sequence.hasOwnProperty(part)) {\r\n\t\t\t\t\tconst keys = String(part)\r\n\t\t\t\t\t\t.match(rxPercents);\r\n\r\n\t\t\t\t\tif (keys) {\r\n\t\t\t\t\t\tpercentages.push(part);\r\n\t\t\t\t\t\tfor (const key of keys) {\r\n\t\t\t\t\t\t\tconst percent = key === \"from\"\r\n\t\t\t\t\t\t\t\t? 0\r\n\t\t\t\t\t\t\t\t: key === \"to\"\r\n\t\t\t\t\t\t\t\t\t? 100\r\n\t\t\t\t\t\t\t\t\t: parseFloat(key);\r\n\r\n\t\t\t\t\t\t\tif (percent < 0 || percent > 100) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid value as a percentage (0 <= n <= 100):`, name, percent);\r\n\t\t\t\t\t\t\t} else if (isNaN(percent)) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid number as a percentage:`, name, part, key);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (!percents[String(percent)]) {\r\n\t\t\t\t\t\t\t\t\tpercents[String(percent)] = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tpercents[String(percent)].push(part);\r\n\t\t\t\t\t\t\t\tfor (const property in sequence[part]) {\r\n\t\t\t\t\t\t\t\t\tif (!properties.includes(property)) {\r\n\t\t\t\t\t\t\t\t\t\tproperties.push(property);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst orderedPercents = Object.keys(percents)\r\n\t\t\t\t.sort((a, b) => {\r\n\t\t\t\t\tconst a1 = parseFloat(a),\r\n\t\t\t\t\t\tb1 = parseFloat(b);\r\n\r\n\t\t\t\t\treturn a1 > b1 ? 1 : a1 < b1 ? -1 : 0;\r\n\t\t\t\t});\r\n\r\n\t\t\torderedPercents.forEach((key) => {\r\n\t\t\t\tsteps.push.apply(percents[key]);\r\n\t\t\t});\r\n\t\t\tfor (const property of properties) {\r\n\t\t\t\tconst parts: string[] = [],\r\n\t\t\t\t\tpropertyName = camelCase(property);\r\n\r\n\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\tconst stepProperties = sequence[value];\r\n\r\n\t\t\t\t\t\tif (stepProperties[propertyName]) {\r\n\t\t\t\t\t\t\tparts.push(isString(stepProperties[propertyName])\r\n\t\t\t\t\t\t\t\t? stepProperties[propertyName]\r\n\t\t\t\t\t\t\t\t: stepProperties[propertyName][0]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (parts.length) {\r\n\t\t\t\t\tconst realSequence = findPattern(parts, propertyName);\r\n\t\t\t\t\tlet index = 0;\r\n\r\n\t\t\t\t\tif (realSequence) {\r\n\t\t\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\t\t\tconst originalProperty = sequence[value][propertyName];\r\n\r\n\t\t\t\t\t\t\t\tif (originalProperty) {\r\n\t\t\t\t\t\t\t\t\tif (Array.isArray(originalProperty) && originalProperty.length > 1 && (isString(originalProperty[1]) || Array.isArray(originalProperty[1]))) {\r\n\t\t\t\t\t\t\t\t\t\trealSequence[index].easing = validateEasing(originalProperty[1], sequenceList.duration || DEFAULT_DURATION);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\trealSequence[index++].percent = parseFloat(key) / 100;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsequenceList.tweens[propertyName] = realSequence;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerSequence\", registerSequence], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Core \"Velocity\" function.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, StrictVelocityOptions,\r\n\tVelocityElements, VelocityObjectArgs, VelocityOptions, VelocityPromise, VelocityProperty,\r\n\tVelocityResult,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean, isFunction, isNode, isPlainObject, isString, isVelocityResult, isWrapped} from \"./types\";\r\nimport {cloneArray, defineProperty, getValue} from \"./utility\";\r\nimport {Data} from \"./Velocity/data\";\r\nimport {\r\n\tvalidateBegin, validateComplete, validateDelay, validateDuration, validateEasing,\r\n\tvalidateLoop, validateProgress, validateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./Velocity/options\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {queue} from \"./Velocity/queue\";\r\nimport {expandSequence} from \"./Velocity/sequences\";\r\nimport {tick} from \"./Velocity/tick\";\r\nimport {expandProperties} from \"./Velocity/tweens\";\r\n\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\n\r\n/* tslint:disable:max-line-length */\r\n/**\r\n * The main Velocity function. Acts as a gateway to everything else.\r\n */\r\nexport function Velocity(options: VelocityObjectArgs): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, options?: VelocityOptions): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\n/* tslint:enable:max-line-length */\r\nexport function Velocity(this: VelocityElements | void, ...argsList: any[]): VelocityResult {\r\n\tconst\r\n\t\t/**\r\n\t\t * A shortcut to the default options.\r\n\t\t */\r\n\t\tdefaults = DefaultObject,\r\n\t\t/**\r\n\t\t * Shortcut to arguments for file size.\r\n\t\t */\r\n\t\targs = arguments,\r\n\t\t/**\r\n\t\t * Cache of the first argument - this is used often enough to be saved.\r\n\t\t */\r\n\t\targs0 = args[0] as VelocityObjectArgs,\r\n\t\t/**\r\n\t\t * To allow for expressive CoffeeScript code, Velocity supports an\r\n\t\t * alternative syntax in which \"elements\" (or \"e\"), \"properties\" (or\r\n\t\t * \"p\"), and \"options\" (or \"o\") objects are defined on a container\r\n\t\t * object that's passed in as Velocity's sole argument.\r\n\t\t *\r\n\t\t * Note: Some browsers automatically populate arguments with a\r\n\t\t * \"properties\" object. We detect it by checking for its default\r\n\t\t * \"names\" property.\r\n\t\t */\r\n\t\t// TODO: Confirm which browsers - if <=IE8 the we can drop completely\r\n\t\tsyntacticSugar = isPlainObject(args0) && (args0.p || ((isPlainObject(args0.properties) && !(args0.properties as any).names) || isString(args0.properties)));\r\n\tlet\r\n\t\t/**\r\n\t\t * When Velocity is called via the utility function (Velocity()),\r\n\t\t * elements are explicitly passed in as the first parameter. Thus,\r\n\t\t * argument positioning varies.\r\n\t\t */\r\n\t\targumentIndex: number = 0,\r\n\t\t/**\r\n\t\t * The list of elements, extended with Promise and Velocity.\r\n\t\t */\r\n\t\telements: VelocityResult,\r\n\t\t/**\r\n\t\t * The properties being animated. This can be a string, in which case it\r\n\t\t * is either a function for these elements, or it is a \"named\" animation\r\n\t\t * sequence to use instead. Named sequences start with either \"callout.\"\r\n\t\t * or \"transition.\". When used as a callout the values will be reset\r\n\t\t * after finishing. When used as a transtition then there is no special\r\n\t\t * handling after finishing.\r\n\t\t */\r\n\t\tpropertiesMap: string | Properties,\r\n\t\t/**\r\n\t\t * Options supplied, this will be mapped and validated into\r\n\t\t * options.\r\n\t\t */\r\n\t\toptionsMap: VelocityOptions,\r\n\t\t/**\r\n\t\t * If called via a chain then this contains the last calls\r\n\t\t * animations. If this does not have a value then any access to the\r\n\t\t * element's animations needs to be to the currently-running ones.\r\n\t\t */\r\n\t\tanimations: AnimationCall[],\r\n\t\t/**\r\n\t\t * The promise that is returned.\r\n\t\t */\r\n\t\tpromise: Promise,\r\n\t\t// Used when the animation is finished\r\n\t\tresolver: (value?: VelocityResult) => void,\r\n\t\t// Used when there was an issue with one or more of the Velocity arguments\r\n\t\trejecter: (reason: any) => void;\r\n\r\n\t//console.log(`Velocity`, _arguments)\r\n\t// First get the elements, and the animations connected to the last call if\r\n\t// this is chained.\r\n\t// TODO: Clean this up a bit\r\n\t// TODO: Throw error if the chain is called with elements as the first argument. isVelocityResult(this) && ( (isNode(arg0) || isWrapped(arg0)) && arg0 == this)\r\n\tif (isNode(this)) {\r\n\t\t// This is from a chain such as document.getElementById(\"\").velocity(...)\r\n\t\telements = [this as HTMLorSVGElement] as VelocityResult;\r\n\t} else if (isWrapped(this)) {\r\n\t\t// This might be a chain from something else, but if chained from a\r\n\t\t// previous Velocity() call then grab the animations it's related to.\r\n\t\telements = cloneArray(this as HTMLorSVGElement[]) as VelocityResult;\r\n\t\tif (isVelocityResult(this)) {\r\n\t\t\tanimations = (this as VelocityResult).velocity.animations;\r\n\t\t}\r\n\t} else if (syntacticSugar) {\r\n\t\telements = cloneArray(args0.elements || args0.e) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isNode(args0)) {\r\n\t\telements = cloneArray([args0]) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isWrapped(args0)) {\r\n\t\telements = cloneArray(args0) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t}\r\n\t// Allow elements to be chained.\r\n\tif (elements) {\r\n\t\tdefineProperty(elements, \"velocity\", Velocity.bind(elements));\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t// Next get the propertiesMap and options.\r\n\tif (syntacticSugar) {\r\n\t\tpropertiesMap = getValue(args0.properties, args0.p);\r\n\t} else {\r\n\t\t// TODO: Should be possible to call Velocity(\"pauseAll\") - currently not possible\r\n\t\tpropertiesMap = args[argumentIndex++] as string | Properties;\r\n\t}\r\n\t// Get any options map passed in as arguments first, expand any direct\r\n\t// options if possible.\r\n\tconst isReverse = propertiesMap === \"reverse\",\r\n\t\tisAction = !isReverse && isString(propertiesMap),\r\n\t\tmaybeSequence = isAction && SequencesObject[propertiesMap as string],\r\n\t\topts = syntacticSugar ? getValue(args0.options, args0.o) : args[argumentIndex];\r\n\r\n\tif (isPlainObject(opts)) {\r\n\t\toptionsMap = opts;\r\n\t}\r\n\t// Create the promise if supported and wanted.\r\n\tif (Promise && getValue(optionsMap && optionsMap.promise, defaults.promise)) {\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\trejecter = reject;\r\n\t\t\t// IMPORTANT:\r\n\t\t\t// If a resolver tries to run on a Promise then it will wait until\r\n\t\t\t// that Promise resolves - but in this case we're running on our own\r\n\t\t\t// Promise, so need to make sure it's not seen as one. Setting these\r\n\t\t\t// values to undefined for the duration of the resolve.\r\n\t\t\t// Due to being an async call, they should be back to \"normal\"\r\n\t\t\t// before the .then() function gets called.\r\n\t\t\tresolver = (result: VelocityResult) => {\r\n\t\t\t\tif (isVelocityResult(result)) {\r\n\t\t\t\t\tconst then = result && result.then;\r\n\r\n\t\t\t\t\tif (then) {\r\n\t\t\t\t\t\tresult.then = undefined; // Preserving enumeration etc\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t\tif (then) {\r\n\t\t\t\t\t\tresult.then = then;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t});\r\n\t\tif (elements) {\r\n\t\t\tdefineProperty(elements, \"then\", promise.then.bind(promise));\r\n\t\t\tdefineProperty(elements, \"catch\", promise.catch.bind(promise));\r\n\t\t\tif ((promise as any).finally) {\r\n\t\t\t\t// Semi-standard\r\n\t\t\t\tdefineProperty(elements, \"finally\", (promise as any).finally.bind(promise));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst promiseRejectEmpty: boolean = getValue(optionsMap && optionsMap.promiseRejectEmpty, defaults.promiseRejectEmpty);\r\n\r\n\tif (promise) {\r\n\t\tif (!elements && !isAction) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No elements supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t} else if (!propertiesMap) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No properties supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ((!elements && !isAction) || !propertiesMap) {\r\n\t\treturn promise as any;\r\n\t}\r\n\r\n\t// NOTE: Can't use isAction here due to type inference - there are callbacks\r\n\t// between so the type isn't considered safe.\r\n\tif (isAction) {\r\n\t\tconst actionArgs: any[] = [],\r\n\t\t\tpromiseHandler: VelocityPromise = promise && {\r\n\t\t\t\t_promise: promise,\r\n\t\t\t\t_resolver: resolver,\r\n\t\t\t\t_rejecter: rejecter,\r\n\t\t\t};\r\n\r\n\t\twhile (argumentIndex < args.length) {\r\n\t\t\tactionArgs.push(args[argumentIndex++]);\r\n\t\t}\r\n\r\n\t\t// Velocity's behavior is categorized into \"actions\". If a string is\r\n\t\t// passed in instead of a propertiesMap then that will call a function\r\n\t\t// to do something special to the animation linked.\r\n\t\t// There is one special case - \"reverse\" - which is handled differently,\r\n\t\t// by being stored on the animation and then expanded when the animation\r\n\t\t// starts.\r\n\t\tconst action = (propertiesMap as string).replace(/\\..*$/, \"\"),\r\n\t\t\tcallback = ActionsObject[action];\r\n\r\n\t\tif (callback) {\r\n\t\t\tconst result = callback(actionArgs, elements, promiseHandler, propertiesMap as string);\r\n\r\n\t\t\tif (result !== undefined) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\r\n\t\t\treturn elements || promise as any;\r\n\t\t} else if (!maybeSequence) {\r\n\t\t\tconsole.error(`VelocityJS: First argument (${propertiesMap}) was not a property map, a known action, or a registered redirect. Aborting.`);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tlet hasValidDuration: boolean;\r\n\r\n\tif (isPlainObject(propertiesMap) || isReverse || maybeSequence) {\r\n\t\t/**\r\n\t\t * The options for this set of animations.\r\n\t\t */\r\n\t\tconst options: StrictVelocityOptions = {};\r\n\t\tlet isSync = defaults.sync;\r\n\r\n\t\t// Private options first - set as non-enumerable, and starting with an\r\n\t\t// underscore so we can filter them out.\r\n\t\tif (promise) {\r\n\t\t\tdefineProperty(options, \"_promise\", promise);\r\n\t\t\tdefineProperty(options, \"_rejecter\", rejecter);\r\n\t\t\tdefineProperty(options, \"_resolver\", resolver);\r\n\t\t}\r\n\t\tdefineProperty(options, \"_ready\", 0);\r\n\t\tdefineProperty(options, \"_started\", 0);\r\n\t\tdefineProperty(options, \"_completed\", 0);\r\n\t\tdefineProperty(options, \"_total\", 0);\r\n\r\n\t\t// Now check the optionsMap\r\n\t\tif (isPlainObject(optionsMap)) {\r\n\t\t\tconst validDuration = validateDuration(optionsMap.duration);\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\toptions.duration = getValue(validDuration, defaults.duration);\r\n\t\t\toptions.delay = getValue(validateDelay(optionsMap.delay), defaults.delay);\r\n\t\t\t// Need the extra fallback here in case it supplies an invalid\r\n\t\t\t// easing that we need to overrride with the default.\r\n\t\t\toptions.easing = validateEasing(getValue(optionsMap.easing, defaults.easing), options.duration) || validateEasing(defaults.easing, options.duration);\r\n\t\t\toptions.loop = getValue(validateLoop(optionsMap.loop), defaults.loop);\r\n\t\t\toptions.repeat = options.repeatAgain = getValue(validateRepeat(optionsMap.repeat), defaults.repeat);\r\n\t\t\tif (optionsMap.speed != null) {\r\n\t\t\t\toptions.speed = getValue(validateSpeed(optionsMap.speed), 1);\r\n\t\t\t}\r\n\t\t\tif (isBoolean(optionsMap.promise)) {\r\n\t\t\t\toptions.promise = optionsMap.promise;\r\n\t\t\t}\r\n\t\t\toptions.queue = getValue(validateQueue(optionsMap.queue), defaults.queue);\r\n\t\t\tif (optionsMap.mobileHA && !StateObject.isGingerbread) {\r\n\t\t\t\t/* When set to true, and if this is a mobile device, mobileHA automatically enables hardware acceleration (via a null transform hack)\r\n\t\t\t\t on animating elements. HA is removed from the element at the completion of its animation. */\r\n\t\t\t\t/* Note: Android Gingerbread doesn't support HA. If a null transform hack (mobileHA) is in fact set, it will prevent other tranform subproperties from taking effect. */\r\n\t\t\t\t/* Note: You can read more about the use of mobileHA in Velocity's documentation: velocity-animate/#mobileHA. */\r\n\t\t\t\toptions.mobileHA = true;\r\n\t\t\t}\r\n\t\t\tif (!isReverse) {\r\n\t\t\t\tif (optionsMap.display != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).display = optionsMap.display as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.display\" used, this is now a property:`, optionsMap.display);\r\n\t\t\t\t}\r\n\t\t\t\tif (optionsMap.visibility != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).visibility = optionsMap.visibility as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.visibility\" used, this is now a property:`, optionsMap.visibility);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: Allow functional options for different options per element\r\n\t\t\tconst optionsBegin = validateBegin(optionsMap.begin),\r\n\t\t\t\toptionsComplete = validateComplete(optionsMap.complete),\r\n\t\t\t\toptionsProgress = validateProgress(optionsMap.progress),\r\n\t\t\t\toptionsSync = validateSync(optionsMap.sync);\r\n\r\n\t\t\tif (optionsBegin != null) {\r\n\t\t\t\toptions.begin = optionsBegin;\r\n\t\t\t}\r\n\t\t\tif (optionsComplete != null) {\r\n\t\t\t\toptions.complete = optionsComplete;\r\n\t\t\t}\r\n\t\t\tif (optionsProgress != null) {\r\n\t\t\t\toptions.progress = optionsProgress;\r\n\t\t\t}\r\n\t\t\tif (optionsSync != null) {\r\n\t\t\t\tisSync = optionsSync;\r\n\t\t\t}\r\n\t\t} else if (!syntacticSugar) {\r\n\t\t\t// Expand any direct options if possible.\r\n\t\t\tconst validDuration = validateDuration(args[argumentIndex], true);\r\n\t\t\tlet offset = 0;\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\tif (validDuration !== undefined) {\r\n\t\t\t\toffset++;\r\n\t\t\t\toptions.duration = validDuration;\r\n\t\t\t}\r\n\t\t\tif (!isFunction(args[argumentIndex + offset])) {\r\n\t\t\t\t// Despite coming before Complete, we can't pass a fn easing\r\n\t\t\t\tconst easing = validateEasing(args[argumentIndex + offset], getValue(options && validateDuration(options.duration), defaults.duration) as number, true);\r\n\r\n\t\t\t\tif (easing !== undefined) {\r\n\t\t\t\t\toffset++;\r\n\t\t\t\t\toptions.easing = easing;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst complete = validateComplete(args[argumentIndex + offset], true);\r\n\r\n\t\t\tif (complete !== undefined) {\r\n\t\t\t\toptions.complete = complete;\r\n\t\t\t}\r\n\t\t\toptions.loop = defaults.loop;\r\n\t\t\toptions.repeat = options.repeatAgain = defaults.repeat;\r\n\t\t}\r\n\r\n\t\tif (isReverse && options.queue === false) {\r\n\t\t\tthrow new Error(\"VelocityJS: Cannot reverse a queue:false animation.\");\r\n\t\t}\r\n\r\n\t\tif (maybeSequence && !hasValidDuration && maybeSequence.duration) {\r\n\t\t\toptions.duration = maybeSequence.duration;\r\n\t\t}\r\n\r\n\t\t// When a set of elements is targeted by a Velocity call, the set is\r\n\t\t// broken up and each element has the current Velocity call individually\r\n\t\t// queued onto it. In this way, each element's existing queue is\r\n\t\t// respected; some elements may already be animating and accordingly\r\n\t\t// should not have this current Velocity call triggered immediately\r\n\t\t// unless the sync:true option is used.\r\n\r\n\t\tconst rootAnimation: AnimationCall = {\r\n\t\t\toptions,\r\n\t\t\telements,\r\n\t\t\t_prev: undefined,\r\n\t\t\t_next: undefined,\r\n\t\t\t_flags: isSync ? AnimationFlags.SYNC : 0,\r\n\t\t\tpercentComplete: 0,\r\n\t\t\tellapsedTime: 0,\r\n\t\t\ttimeStart: 0,\r\n\t\t};\r\n\r\n\t\tanimations = [];\r\n\t\tfor (const element of elements) {\r\n\t\t\tlet flags = 0;\r\n\r\n\t\t\tif (isNode(element)) { // TODO: This needs to check for valid animation targets, not just Elements\r\n\t\t\t\tif (isReverse) {\r\n\t\t\t\t\tconst lastAnimation = Data(element).lastAnimationList[options.queue as string];\r\n\r\n\t\t\t\t\tpropertiesMap = lastAnimation && lastAnimation.tweens;\r\n\t\t\t\t\tif (!propertiesMap) {\r\n\t\t\t\t\t\tconsole.error(`VelocityJS: Attempting to reverse an animation on an element with no previous animation:`, element);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tflags |= AnimationFlags.REVERSE & ~(lastAnimation._flags & AnimationFlags.REVERSE); // tslint:disable-line:no-bitwise\r\n\t\t\t\t}\r\n\t\t\t\tconst animation: AnimationCall = {\r\n\t\t\t\t\t...rootAnimation,\r\n\t\t\t\t\telement,\r\n\t\t\t\t\t_flags: rootAnimation._flags | flags, // tslint:disable-line:no-bitwise\r\n\t\t\t\t};\r\n\r\n\t\t\t\toptions._total++;\r\n\t\t\t\tanimations.push(animation);\r\n\t\t\t\tif (maybeSequence) {\r\n\t\t\t\t\texpandSequence(animation, maybeSequence);\r\n\t\t\t\t} else if (isReverse) {\r\n\t\t\t\t\t// In this case we're using the previous animation, so\r\n\t\t\t\t\t// it will be expanded correctly when that one runs.\r\n\t\t\t\t\tanimation.tweens = propertiesMap as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tanimation.tweens = Object.create(null);\r\n\t\t\t\t\texpandProperties(animation, propertiesMap);\r\n\t\t\t\t}\r\n\t\t\t\tqueue(element, animation, options.queue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (StateObject.isTicking === false) {\r\n\t\t\t// If the animation tick isn't running, start it. (Velocity shuts it\r\n\t\t\t// off when there are no active calls to process.)\r\n\t\t\ttick(false);\r\n\t\t}\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t/***************\r\n\t Chaining\r\n\t ***************/\r\n\r\n\t/* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */\r\n\treturn elements || promise as any;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {defineProperty} from \"../utility\";\r\nimport {Velocity} from \"../velocityFn\";\r\n\r\n/**\r\n * Used to patch any object to allow Velocity chaining. In order to chain an\r\n * object must either be treatable as an array - with a .length\r\n * property, and each member a Node, or a Node directly.\r\n *\r\n * By default Velocity will try to patch window,\r\n * jQuery, Zepto, and several classes that return\r\n * Nodes or lists of Nodes.\r\n */\r\nexport function patch(proto: any, global?: boolean) {\r\n\ttry {\r\n\t\tdefineProperty(proto, (global ? \"V\" : \"v\") + \"elocity\", Velocity);\r\n\t} catch (e) {\r\n\t\tconsole.warn(`VelocityJS: Error when trying to add prototype.`, e);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n"],"names":["variable","Object","prototype","toString","call","nodeType","proto","getPrototypeOf","hasOwnProperty","constructor","isNumber","length","isFunction","velocity","window","isString","isNode","obj","property","propertyIsEnumerable","element","className","Element","classList","add","arrayLike","Array","slice","name","value","readonly","defineProperty","args","arguments","arg","undefined","now","Date","getTime","remove","replace","RegExp","Actions","internal","callback","warn","registerAction","DURATION_FAST","DURATION_NORMAL","DURATION_SLOW","FUZZY_MS_PER_SECOND","DEFAULT_CACHE","DEFAULT_DELAY","DEFAULT_DURATION","DEFAULT_EASING","DEFAULT_FPSLIMIT","DEFAULT_LOOP","DEFAULT_PROMISE","DEFAULT_PROMISE_REJECT_EMPTY","DEFAULT_QUEUE","DEFAULT_REPEAT","DEFAULT_SPEED","DEFAULT_SYNC","CLASSNAME","Duration","Easings","registerEasing","percentComplete","startValue","endValue","Math","cos","PI","exp","linearEasing","swingEasing","springEasing","num","min","max","aA1","aA2","aT","A","B","C","mX1","mY1","mX2","mY2","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","i","isNaN","isFinite","fixRange","mSampleValues","Float32Array","aX","aGuessT","currentSlope","getSlope","currentX","calcBezier","aA","aB","currentT","abs","lastSample","intervalStart","currentSample","dist","guessForT","initialSlope","newtonRaphsonIterate","binarySubdivide","precomputed","str","f","getTForX","getControlPoints","x","y","easeIn","generateBezier","easeOut","easeInOut","state","tension","friction","v","initialState","dt","derivative","dx","dv","springAccelerationForState","a","b","springEvaluateStateWithDerivative","c","d","dxdt","dvdt","duration","initState","parseFloat","path","tolerance","DT","haveDuration","timeLapsed","lastState","generateSpringRK4","springIntegrateState","push","floor","cache","steps","fn","round","def","toLowerCase","parseDuration","isBoolean","noError","parsed","error","isArray","generateStep","apply","parseInt","defaults","begin","complete","delay","easing","fpsLimit","loop","mobileHA","minFrameTime","promise","promiseRejectEmpty","queue","repeat","speed","sync","defineProperties","validateEasing","validateCache","validateBegin","validateComplete","validateDelay","validateDuration","validateFpsLimit","validateLoop","validatePromise","validatePromiseRejectEmpty","validateQueue","validateRepeat","validateSpeed","validateSync","reset","Normalizations","NormalizationUnits","NoCacheNormalizations","Set","constructors","constructorCache","Map","dataName","data","ownerDocument","defaultView","types","index","newData","isClient","windowScrollAnchor","pageYOffset","State","test","navigator","userAgent","chrome","document","createElement","documentElement","body","parentNode","animation","prev","last","_prev","_next","first","firstNew","Data","count","queueName","lastAnimationList","queueList","skip","next","options","activeCall","elements","getValue","isLoop","isRepeat","isStopped","_flags","repeatAgain","lastFinishList","timeStart","ellapsedTime","_completed","_total","resolver","_resolver","indexOf","nextArg","has","get","set","unit","units","includes","propertyName","registerNormalization","hasNormalization","propertyValue","noCache","getNormalization","Velocity","debug","info","fixed","$","letter","toUpperCase","rxColor6","rxColor3","rxColorName","rxRGB","rxSpaces","ColorNames","ignore","r","g","makeRGBA","$0","$1","$2","wantInner","isBorderBox","getPropertyValue","sides","fields","augment","field","getBoundingClientRect","augmentDimension","computedStyle","getComputedStyle","computedValue","getWidthHeight","String","style","position","topLeft","skipCache","rxHex","commands","elementArrayIndex","tween","getNormalizationUnit","fixColors","properties","tweens","create","camelCase","valueData","log","arr1","arr2","end","start","rxToken","rxNumber","parts","partsLength","tokens","indexes","numbers","part","cloneArray","match","sequence","pattern","addString","text","returnStringType","isDisplay","isVisibility","more","bits","isUnitless","hasNumbers","token","digits","change","changeOrUnit","index2","splice","firstLetter","patternCalc","isComplex","isMaths","bit","substring","inRGB","starting","findPattern","startNumbers","percent","JSON","stringify","timeCurrent","tweenValue","progress","nextCall","firstProgress","_nextProgress","lastTick","firstComplete","_nextComplete","FRAME_TIME","performance","perf","nowOffset","timing","navigationStart","rAFProxy","setTimeout","rAFShim","requestAnimationFrame","ticking","worker","interval","onmessage","e","setInterval","postMessage","Worker","URL","createObjectURL","Blob","workerFn","isMobile","hidden","addEventListener","isTicking","timestamp","deltaTime","defaultSpeed","defaultEasing","defaultDuration","lastProgress","lastComplete","flags","_ready","_started","_first","delta","activeEasing","millisecondsEllapsed","mock","reverse","currentValue","easingComplete","best","j","tweenFrom","tweenTo","tweenPercent","result","startsWith","asyncCallbacks","tick","defaultQueue","endValues","promiseHandler","finishAll","isVelocityResult","animations","then","finish","animationFlags","isReady","isStarted","isPaused","isSync","isReverse","action","key","flag","isPercentComplete","option","pauseResume","SyntaxError","stop","isPlainObject","_rejecter","join","styleAction","requireForcefeeding","Error","fakeAnimation","singleResult","maybeSequence","SequencesObject","propertyTween","tweenEasing","tweenAction","colorValues","color","amount","pow","registerBackIn","registerBackOut","registerBackInOut","easeOutBouncePercent","easeInBouncePercent","easeInBounce","easeOutBounce","easeInOutBounce","PI2","amplitude","period","sin","asin","s","registerElasticIn","registerElasticOut","registerElasticInOut","atStart","during","atEnd","getDimension","inlineRx","listItemRx","tableRowRx","tableRx","tableRowGroupRx","computePropertyValue","nodeName","display","clientWidth","scrollWidth","clientHeight","scrollHeight","direction","client","scrollValue","scroll","rxAddPx","unprefixed","rxVendors","prefixElement","addUnit","getSetPrefixed","getSetStyle","getAttribute","setAttribute","base","rxSubtype","rxElement","getOwnPropertyNames","forEach","subtype","exec","createElementNS","attribute","getBBox","getSetTween","VERSION","VelocityFn","VelocityStatic","ActionsObject","EasingsObject","StateObject","DefaultObject","patchFn","IE","documentMode","div","innerHTML","getElementsByTagName","jQuery","Zepto","NodeList","HTMLCollection","rxPercents","percents","percentages","keys","orderedPercents","sort","a1","b1","stepProperties","realSequence","originalProperty","sequenceList","registerSequence","argsList","args0","p","names","isWrapped","syntacticSugar","bind","argumentIndex","propertiesMap","isAction","opts","o","Promise","optionsMap","resolve","reject","catch","finally","actionArgs","rejecter","hasValidDuration","validDuration","isGingerbread","visibility","optionsBegin","optionsComplete","optionsProgress","validateProgress","optionsSync","offset","rootAnimation","lastAnimation","global"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;;;AAGA,mBAA0BA;WAClBA,aAAa,IAAb,IAAqBA,aAAa,KAAzC;;AAGD;;;AAgBA,oBAA2BA;WACnBC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,QAA/B,MAA6C,mBAApD;;;;;AAMD,gBAAuBA;WACf,CAAC,EAAEA,YAAaA,SAAqBK,QAApC,CAAR;;;;;AAMD,kBAAyBL;WACjB,OAAOA,QAAP,KAAoB,QAA3B;;AAGD;;;AAUA,uBAA8BA;QACzB,CAACA,QAAD,IAAa,QAAOA,QAAP,yCAAOA,QAAP,OAAoB,QAAjC,IAA8CA,SAAqBK,QAAnE,IAA+EJ,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,QAA/B,MAA6C,iBAAhI,EAAmJ;eAC3I,KAAP;;QAEKM,QAAQL,OAAOM,cAAP,CAAsBP,QAAtB,CAAd;WAEO,CAACM,KAAD,IAAWA,MAAME,cAAN,CAAqB,aAArB,KAAuCF,MAAMG,WAAN,KAAsBR,MAA/E;;AAGD;;;AAUA,kBAAyBD;WACjB,OAAOA,QAAP,KAAoB,QAA3B;;;;;AAMD,0BAAiCA;WACzBA,YAAYU,SAAUV,SAA4BW,MAAtC,CAAZ,IAA6DC,WAAYZ,SAA4Ba,QAAxC,CAApE;;;;;;AAQD,mBAA0Bb;WAClBA,YACHA,aAAac,MADV,IAEHJ,SAAUV,SAAgCW,MAA1C,CAFG,IAGH,CAACI,SAASf,QAAT,CAHE,IAIH,CAACY,WAAWZ,QAAX,CAJE,IAKH,CAACgB,OAAOhB,QAAP,CALE,KAMDA,SAAgCW,MAAhC,KAA2C,CAA3C,IAAgDK,OAAOhB,SAAS,CAAT,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No newline at end of file +{"version":3,"file":"velocity.es5.js","sources":["src/types.ts","src/utility.ts","src/Velocity/actions/actions.ts","src/constants.ts","src/Velocity/easing/easings.ts","src/Velocity/easing/bezier.ts","src/Velocity/easing/spring_rk4.ts","src/Velocity/easing/step.ts","src/Velocity/options.ts","src/Velocity/defaults.ts","src/Velocity/normalizations/normalizationsObject.ts","src/Velocity/data.ts","src/Velocity/state.ts","src/Velocity/queue.ts","src/Velocity/complete.ts","src/Velocity/normalizations/normalizations.ts","src/Velocity/css/setPropertyValue.ts","src/Velocity/camelCase.ts","src/Velocity/css/fixColors.ts","src/Velocity/css/augmentDimension.ts","src/Velocity/css/getPropertyValue.ts","src/Velocity/tweens.ts","src/Velocity/tick.ts","src/Velocity/actions/finish.ts","src/Velocity/actions/option.ts","src/Velocity/actions/pauseResume.ts","src/Velocity/actions/reverse.ts","src/Velocity/actions/stop.ts","src/Velocity/actions/style.ts","src/Velocity/actions/tween.ts","src/Velocity/css/colors.ts","src/Velocity/easing/back.ts","src/Velocity/easing/bounce.ts","src/Velocity/easing/elastic.ts","src/Velocity/easing/string.ts","src/Velocity/normalizations/dimensions.ts","src/Velocity/normalizations/display.ts","src/Velocity/normalizations/scroll.ts","src/Velocity/normalizations/style.ts","src/Velocity/normalizations/svg/attributes.ts","src/Velocity/normalizations/svg/dimensions.ts","src/Velocity/normalizations/tween.ts","version.ts","src/velocity.ts","src/Velocity/sequences.ts","src/velocityFn.ts","src/Velocity/patch.ts","src/velocity.ts"],"sourcesContent":["/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Runtime type checking methods.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityResult} from \"./../velocity.d\";\r\n\r\n/**\r\n * Check if a variable is a boolean.\r\n */\r\nexport function isBoolean(variable: any): variable is boolean {\r\n\treturn variable === true || variable === false;\r\n}\r\n\r\n/**\r\n * Check if a variable is an empty object.\r\n */\r\nexport function isEmptyObject(variable: {}): variable is {} {\r\n\tfor (const name in variable) {\r\n\t\tif (variable.hasOwnProperty(name)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Check if a variable is a function.\r\n */\r\nexport function isFunction(variable: any): variable is Function { // tslint:disable-line:ban-types\r\n\treturn Object.prototype.toString.call(variable) === \"[object Function]\";\r\n}\r\n\r\n/**\r\n * Check if a variable is an HTMLElement or SVGElement.\r\n */\r\nexport function isNode(variable: any): variable is HTMLorSVGElement {\r\n\treturn !!(variable && (variable as Element).nodeType);\r\n}\r\n\r\n/**\r\n * Check if a variable is a number.\r\n */\r\nexport function isNumber(variable: any): variable is number {\r\n\treturn typeof variable === \"number\";\r\n}\r\n\r\n/**\r\n * Faster way to parse a string/number as a number https://jsperf.com/number-vs-parseint-vs-plus/3\r\n */\r\nexport function isNumberWhenParsed(variable: any): variable is number {\r\n\treturn !isNaN(Number(variable));\r\n}\r\n\r\n/**\r\n * Check if a variable is a plain object (and not an instance).\r\n */\r\nexport function isPlainObject(variable: any): variable is {} {\r\n\tif (!variable || typeof variable !== \"object\" || (variable as Element).nodeType || Object.prototype.toString.call(variable) !== \"[object Object]\") {\r\n\t\treturn false;\r\n\t}\r\n\tconst proto = Object.getPrototypeOf(variable) as object;\r\n\r\n\treturn !proto || (proto.hasOwnProperty(\"constructor\") && proto.constructor === Object);\r\n}\r\n\r\n/**\r\n * Check if a variable is an SVGElement.\r\n */\r\nexport function isSVG(variable: any): variable is SVGElement {\r\n\treturn SVGElement && variable instanceof SVGElement;\r\n}\r\n\r\n/**\r\n * Check if a variable is a string.\r\n */\r\nexport function isString(variable: any): variable is string {\r\n\treturn typeof variable === \"string\";\r\n}\r\n\r\n/**\r\n * Check if a variable is the result of calling Velocity.\r\n */\r\nexport function isVelocityResult(variable: any): variable is VelocityResult {\r\n\treturn variable && isNumber((variable as VelocityResult).length) && isFunction((variable as VelocityResult).velocity);\r\n}\r\n\r\n/**\r\n * Check if a variable is an array-like wrapped jQuery, Zepto or similar, where\r\n * each indexed value is a Node.\r\n */\r\n\r\nexport function isWrapped(variable: any): variable is HTMLorSVGElement[] {\r\n\treturn variable\r\n\t\t&& variable !== window\r\n\t\t&& isNumber((variable as HTMLorSVGElement[]).length)\r\n\t\t&& !isString(variable)\r\n\t\t&& !isFunction(variable)\r\n\t\t&& !isNode(variable)\r\n\t\t&& ((variable as HTMLorSVGElement[]).length === 0 || isNode(variable[0]));\r\n}\r\n\r\n/**\r\n * Check is a property is an enumerable member of an object.\r\n */\r\nexport function propertyIsEnumerable(obj: object, property: string): boolean {\r\n\treturn Object.prototype.propertyIsEnumerable.call(obj, property);\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isNode} from \"./types\";\r\n\r\n/**\r\n * Add a single className to an Element.\r\n */\r\nexport function addClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.add(className);\r\n\t\t} else {\r\n\t\t\tremoveClass(element, className);\r\n\t\t\t(element as any).className += (element.className.length ? \" \" : \"\") + className;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Clone an array, works for array-like too.\r\n */\r\nexport function cloneArray(arrayLike: T[] | ArrayLike): T[] {\r\n\treturn Array.prototype.slice.call(arrayLike, 0);\r\n}\r\n\r\n/**\r\n * The defineProperty() function provides a\r\n * shortcut to defining a property that cannot be accidentally iterated across.\r\n */\r\nexport function defineProperty(proto: any, name: string, value: any, readonly?: boolean) {\r\n\tif (proto) {\r\n\t\tObject.defineProperty(proto, name, {\r\n\t\t\tconfigurable: !readonly,\r\n\t\t\twritable: !readonly,\r\n\t\t\tvalue,\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * When there are multiple locations for a value pass them all in, then get the\r\n * first value that is valid.\r\n */\r\nexport function getValue(...args: T[]): T {\r\n\tfor (const arg of arguments) {\r\n\t\tif (arg !== undefined && arg === arg) {\r\n\t\t\treturn arg;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Shim to get the current milliseconds - on anything except old IE it'll use\r\n * Date.now() and save creating an object. If that doesn't exist then it'll\r\n * create one that gets GC.\r\n */\r\nexport const now = Date.now ? Date.now : () => {\r\n\treturn (new Date()).getTime();\r\n};\r\n\r\n/**\r\n * Remove a single className from an Element.\r\n */\r\nexport function removeClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.remove(className);\r\n\t\t} else {\r\n\t\t\t// TODO: Need some jsperf tests on performance - can we get rid of the regex and maybe use split / array manipulation?\r\n\t\t\t(element as any).className = element.className.replace(new RegExp(`(^|\\\\s)${className}(\\\\s|$)`, \"gi\"), \" \");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Convert an element or array-like element list into an array if needed.\r\n */\r\nexport function sanitizeElements(elements: HTMLorSVGElement | HTMLorSVGElement[]): HTMLorSVGElement[] {\r\n\treturn isNode(elements)\r\n\t\t? [elements] as HTMLorSVGElement[]\r\n\t\t: elements as HTMLorSVGElement[];\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityActionFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString, propertyIsEnumerable} from \"../../types\";\r\nimport {defineProperty} from \"../../utility\";\r\n\r\n// Constants\r\nexport const Actions: {[name: string]: VelocityActionFn} = {};\r\n\r\n/**\r\n * Used to register an action. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerAction\", \"name\", VelocityActionFn);\r\n */\r\nexport function registerAction(args?: [string, VelocityActionFn], internal?: boolean) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' callback to an invalid value:`, name, callback);\r\n\t} else if (Actions[name] && !propertyIsEnumerable(Actions, name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override internal 'registerAction' callback`, name);\r\n\t} else if (internal === true) {\r\n\t\tdefineProperty(Actions, name, callback);\r\n\t} else {\r\n\t\tActions[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerAction\", registerAction as any], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Constants and defaults. These values should never change without a MINOR\r\n * version bump.\r\n */\r\n\r\n/**\r\n * Without this it will only un-prefix properties that have a valid \"normal\"\r\n * version.\r\n */\r\nexport const ALL_VENDOR_PREFIXES = true;\r\n\r\nexport const DURATION_FAST = 200;\r\nexport const DURATION_NORMAL = 400;\r\nexport const DURATION_SLOW = 600;\r\n\r\nexport const FUZZY_MS_PER_SECOND = 980;\r\n\r\nexport const DEFAULT_CACHE = true;\r\nexport const DEFAULT_DELAY = 0;\r\nexport const DEFAULT_DURATION = DURATION_NORMAL;\r\nexport const DEFAULT_EASING = \"swing\";\r\nexport const DEFAULT_FPSLIMIT = 60;\r\nexport const DEFAULT_LOOP = 0;\r\nexport const DEFAULT_PROMISE = true;\r\nexport const DEFAULT_PROMISE_REJECT_EMPTY = true;\r\nexport const DEFAULT_QUEUE = \"\";\r\nexport const DEFAULT_REPEAT = 0;\r\nexport const DEFAULT_SPEED = 1;\r\nexport const DEFAULT_SYNC = true;\r\n\r\nexport const CLASSNAME = \"velocity-animating\";\r\n\r\nexport const Duration = {\r\n\tfast: DURATION_FAST,\r\n\tnormal: DURATION_NORMAL,\r\n\tslow: DURATION_SLOW,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\n\r\n// Constants\r\nexport const Easings: {[name: string]: VelocityEasingFn} = {};\r\n\r\n/**\r\n * Used to register a easing. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerEasing\", \"name\", VelocityEasingFn);\r\n */\r\nexport function registerEasing(args?: [string, VelocityEasingFn]) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' callback to an invalid value:`, name, callback);\r\n\t} else if (Easings[name]) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override 'registerEasing' callback`, name);\r\n\t} else {\r\n\t\tEasings[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerEasing\", registerEasing], true);\r\n\r\n/**\r\n * Linear easing, used for sequence parts that don't have an actual easing\r\n * function.\r\n */\r\nexport function linearEasing(percentComplete, startValue, endValue, property) {\r\n\treturn startValue + percentComplete * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * Swing is the default for jQuery and Velocity.\r\n */\r\nexport function swingEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (0.5 - Math.cos(percentComplete * Math.PI) / 2) * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * A less exaggerated version of easeInOutElastic.\r\n */\r\nexport function springEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (1 - (Math.cos(percentComplete * 4.5 * Math.PI) * Math.exp(-percentComplete * 6))) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"linear\", linearEasing]);\r\nregisterEasing([\"swing\", swingEasing]);\r\nregisterEasing([\"spring\", springEasing]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Fix to a range of 0 <= num <= 1.\r\n */\r\nfunction fixRange(num: number) {\r\n\treturn Math.min(Math.max(num, 0), 1);\r\n}\r\n\r\nfunction A(aA1, aA2) {\r\n\treturn 1 - 3 * aA2 + 3 * aA1;\r\n}\r\n\r\nfunction B(aA1, aA2) {\r\n\treturn 3 * aA2 - 6 * aA1;\r\n}\r\n\r\nfunction C(aA1) {\r\n\treturn 3 * aA1;\r\n}\r\n\r\nfunction calcBezier(aT, aA1, aA2) {\r\n\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\r\n}\r\n\r\nfunction getSlope(aT, aA1, aA2) {\r\n\treturn 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);\r\n}\r\n\r\nexport function generateBezier(mX1: number, mY1: number, mX2: number, mY2: number): VelocityEasingFn {\r\n\tconst NEWTON_ITERATIONS = 4,\r\n\t\tNEWTON_MIN_SLOPE = 0.001,\r\n\t\tSUBDIVISION_PRECISION = 0.0000001,\r\n\t\tSUBDIVISION_MAX_ITERATIONS = 10,\r\n\t\tkSplineTableSize = 11,\r\n\t\tkSampleStepSize = 1 / (kSplineTableSize - 1),\r\n\t\tfloat32ArraySupported = \"Float32Array\" in window;\r\n\r\n\t/* Must contain four arguments. */\r\n\tif (arguments.length !== 4) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/* Arguments must be numbers. */\r\n\tfor (let i = 0; i < 4; ++i) {\r\n\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\t/* X values must be in the [0, 1] range. */\r\n\tmX1 = fixRange(mX1);\r\n\tmX2 = fixRange(mX2);\r\n\r\n\tconst mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n\r\n\tfunction newtonRaphsonIterate(aX, aGuessT) {\r\n\t\tfor (let i = 0; i < NEWTON_ITERATIONS; ++i) {\r\n\t\t\tconst currentSlope = getSlope(aGuessT, mX1, mX2);\r\n\r\n\t\t\tif (currentSlope === 0) {\r\n\t\t\t\treturn aGuessT;\r\n\t\t\t}\r\n\r\n\t\t\tconst currentX = calcBezier(aGuessT, mX1, mX2) - aX;\r\n\t\t\taGuessT -= currentX / currentSlope;\r\n\t\t}\r\n\r\n\t\treturn aGuessT;\r\n\t}\r\n\r\n\tfunction calcSampleValues() {\r\n\t\tfor (let i = 0; i < kSplineTableSize; ++i) {\r\n\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction binarySubdivide(aX, aA, aB) {\r\n\t\tlet currentX, currentT, i = 0;\r\n\r\n\t\tdo {\r\n\t\t\tcurrentT = aA + (aB - aA) / 2;\r\n\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\r\n\t\t\tif (currentX > 0) {\r\n\t\t\t\taB = currentT;\r\n\t\t\t} else {\r\n\t\t\t\taA = currentT;\r\n\t\t\t}\r\n\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\r\n\r\n\t\treturn currentT;\r\n\t}\r\n\r\n\tfunction getTForX(aX) {\r\n\t\tconst lastSample = kSplineTableSize - 1;\r\n\t\tlet intervalStart = 0,\r\n\t\t\tcurrentSample = 1;\r\n\r\n\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\r\n\t\t\tintervalStart += kSampleStepSize;\r\n\t\t}\r\n\r\n\t\t--currentSample;\r\n\r\n\t\tconst dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\r\n\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\r\n\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\r\n\r\n\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\r\n\t\t\treturn newtonRaphsonIterate(aX, guessForT);\r\n\t\t} else if (initialSlope === 0) {\r\n\t\t\treturn guessForT;\r\n\t\t} else {\r\n\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\r\n\t\t}\r\n\t}\r\n\r\n\tlet precomputed = false;\r\n\r\n\tfunction precompute() {\r\n\t\tprecomputed = true;\r\n\t\tif (mX1 !== mY1 || mX2 !== mY2) {\r\n\t\t\tcalcSampleValues();\r\n\t\t}\r\n\t}\r\n\r\n\tconst str = `generateBezier(${[mX1, mY1, mX2, mY2]})`,\r\n\t\tf = (percentComplete: number, startValue: number, endValue: number, property?: string) => {\r\n\t\t\tif (!precomputed) {\r\n\t\t\t\tprecompute();\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 0) {\r\n\t\t\t\treturn startValue;\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 1) {\r\n\t\t\t\treturn endValue;\r\n\t\t\t}\r\n\t\t\tif (mX1 === mY1 && mX2 === mY2) {\r\n\t\t\t\treturn startValue + percentComplete * (endValue - startValue);\r\n\t\t\t}\r\n\r\n\t\t\treturn startValue + calcBezier(getTForX(percentComplete), mY1, mY2) * (endValue - startValue);\r\n\t\t};\r\n\r\n\t(f as any).getControlPoints = () => {\r\n\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\r\n\t};\r\n\tf.toString = () => {\r\n\t\treturn str;\r\n\t};\r\n\r\n\treturn f;\r\n}\r\n\r\n/* Common easings */\r\nconst easeIn = generateBezier(0.42, 0, 1, 1),\r\n\teaseOut = generateBezier(0, 0, 0.58, 1),\r\n\teaseInOut = generateBezier(0.42, 0, 0.58, 1);\r\n\r\nregisterEasing([\"ease\", generateBezier(0.25, 0.1, 0.25, 1)]);\r\nregisterEasing([\"easeIn\", easeIn]);\r\nregisterEasing([\"ease-in\", easeIn]);\r\nregisterEasing([\"easeOut\", easeOut]);\r\nregisterEasing([\"ease-out\", easeOut]);\r\nregisterEasing([\"easeInOut\", easeInOut]);\r\nregisterEasing([\"ease-in-out\", easeInOut]);\r\nregisterEasing([\"easeInSine\", generateBezier(0.47, 0, 0.745, 0.715)]);\r\nregisterEasing([\"easeOutSine\", generateBezier(0.39, 0.575, 0.565, 1)]);\r\nregisterEasing([\"easeInOutSine\", generateBezier(0.445, 0.05, 0.55, 0.95)]);\r\nregisterEasing([\"easeInQuad\", generateBezier(0.55, 0.085, 0.68, 0.53)]);\r\nregisterEasing([\"easeOutQuad\", generateBezier(0.25, 0.46, 0.45, 0.94)]);\r\nregisterEasing([\"easeInOutQuad\", generateBezier(0.455, 0.03, 0.515, 0.955)]);\r\nregisterEasing([\"easeInCubic\", generateBezier(0.55, 0.055, 0.675, 0.19)]);\r\nregisterEasing([\"easeOutCubic\", generateBezier(0.215, 0.61, 0.355, 1)]);\r\nregisterEasing([\"easeInOutCubic\", generateBezier(0.645, 0.045, 0.355, 1)]);\r\nregisterEasing([\"easeInQuart\", generateBezier(0.895, 0.03, 0.685, 0.22)]);\r\nregisterEasing([\"easeOutQuart\", generateBezier(0.165, 0.84, 0.44, 1)]);\r\nregisterEasing([\"easeInOutQuart\", generateBezier(0.77, 0, 0.175, 1)]);\r\nregisterEasing([\"easeInQuint\", generateBezier(0.755, 0.05, 0.855, 0.06)]);\r\nregisterEasing([\"easeOutQuint\", generateBezier(0.23, 1, 0.32, 1)]);\r\nregisterEasing([\"easeInOutQuint\", generateBezier(0.86, 0, 0.07, 1)]);\r\nregisterEasing([\"easeInExpo\", generateBezier(0.95, 0.05, 0.795, 0.035)]);\r\nregisterEasing([\"easeOutExpo\", generateBezier(0.19, 1, 0.22, 1)]);\r\nregisterEasing([\"easeInOutExpo\", generateBezier(1, 0, 0, 1)]);\r\nregisterEasing([\"easeInCirc\", generateBezier(0.6, 0.04, 0.98, 0.335)]);\r\nregisterEasing([\"easeOutCirc\", generateBezier(0.075, 0.82, 0.165, 1)]);\r\nregisterEasing([\"easeInOutCirc\", generateBezier(0.785, 0.135, 0.15, 0.86)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\ninterface springState {\r\n\tx: number;\r\n\tv: number;\r\n\ttension: number;\r\n\tfriction: number;\r\n}\r\n\r\ninterface springDelta {\r\n\tdx: number;\r\n\tdv: number;\r\n}\r\n\r\n/* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\r\n/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass\r\n then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\r\nfunction springAccelerationForState(state: springState) {\r\n\treturn (-state.tension * state.x) - (state.friction * state.v);\r\n}\r\n\r\nfunction springEvaluateStateWithDerivative(initialState: springState, dt: number, derivative: springDelta): springDelta {\r\n\tconst state = {\r\n\t\tx: initialState.x + derivative.dx * dt,\r\n\t\tv: initialState.v + derivative.dv * dt,\r\n\t\ttension: initialState.tension,\r\n\t\tfriction: initialState.friction,\r\n\t};\r\n\r\n\treturn {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t};\r\n}\r\n\r\nfunction springIntegrateState(state: springState, dt: number) {\r\n\tconst a = {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t},\r\n\t\tb = springEvaluateStateWithDerivative(state, dt * 0.5, a),\r\n\t\tc = springEvaluateStateWithDerivative(state, dt * 0.5, b),\r\n\t\td = springEvaluateStateWithDerivative(state, dt, c),\r\n\t\tdxdt = 1 / 6 * (a.dx + 2 * (b.dx + c.dx) + d.dx),\r\n\t\tdvdt = 1 / 6 * (a.dv + 2 * (b.dv + c.dv) + d.dv);\r\n\r\n\tstate.x = state.x + dxdt * dt;\r\n\tstate.v = state.v + dvdt * dt;\r\n\r\n\treturn state;\r\n}\r\n\r\nexport function generateSpringRK4(tension: number, friction: number): number;\r\nexport function generateSpringRK4(tension: number, friction: number, duration: number): VelocityEasingFn;\r\nexport function generateSpringRK4(tension: number, friction: number, duration?: number): any {\r\n\tconst initState: springState = {\r\n\t\tx: -1,\r\n\t\tv: 0,\r\n\t\ttension: parseFloat(tension as any) || 500,\r\n\t\tfriction: parseFloat(friction as any) || 20,\r\n\t},\r\n\t\tpath = [0],\r\n\t\ttolerance = 1 / 10000,\r\n\t\tDT = 16 / 1000,\r\n\t\thaveDuration = duration != null; // deliberate \"==\", as undefined == null != 0\r\n\tlet timeLapsed = 0,\r\n\t\tdt: number,\r\n\t\tlastState: springState;\r\n\r\n\t/* Calculate the actual time it takes for this animation to complete with the provided conditions. */\r\n\tif (haveDuration) {\r\n\t\t/* Run the simulation without a duration. */\r\n\t\ttimeLapsed = generateSpringRK4(initState.tension, initState.friction);\r\n\t\t/* Compute the adjusted time delta. */\r\n\t\tdt = (timeLapsed as number) / duration * DT;\r\n\t} else {\r\n\t\tdt = DT;\r\n\t}\r\n\r\n\twhile (true) {\r\n\t\t/* Next/step function .*/\r\n\t\tlastState = springIntegrateState(lastState || initState, dt);\r\n\t\t/* Store the position. */\r\n\t\tpath.push(1 + lastState.x);\r\n\t\ttimeLapsed += 16;\r\n\t\t/* If the change threshold is reached, break. */\r\n\t\tif (!(Math.abs(lastState.x) > tolerance && Math.abs(lastState.v) > tolerance)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\r\n\t computed path and returns a snapshot of the position according to a given percentComplete. */\r\n\treturn !haveDuration ? timeLapsed : (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + path[Math.floor(percentComplete * (path.length - 1))] * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details\r\n *\r\n * Step easing generator.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Constants\r\nconst cache: {[steps: number]: VelocityEasingFn} = {};\r\n\r\nexport function generateStep(steps): VelocityEasingFn {\r\n\tconst fn = cache[steps];\r\n\r\n\tif (fn) {\r\n\t\treturn fn;\r\n\t}\r\n\r\n\treturn cache[steps] = (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + Math.round(percentComplete * steps) * (1 / steps) * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Validation functions used for various types of data that can be supplied.\r\n * All errors are reported in the non-minified version for development. If a\r\n * validation fails then it should return undefined.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityCallback, VelocityEasingFn, VelocityEasingType, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {Duration} from \"../constants\";\r\nimport {isBoolean, isFunction, isNumber, isString} from \"../types\";\r\nimport {generateBezier} from \"./easing/bezier\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {generateSpringRK4} from \"./easing/spring_rk4\";\r\nimport {generateStep} from \"./easing/step\";\r\n\r\n/**\r\n * Parse a duration value and return an ms number. Optionally return a\r\n * default value if the number is not valid.\r\n */\r\nexport function parseDuration(duration: \"fast\" | \"normal\" | \"slow\" | number, def?: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tif (isNumber(duration)) {\r\n\t\treturn duration;\r\n\t}\r\n\tif (isString(duration)) {\r\n\t\treturn Duration[duration.toLowerCase()]\r\n\t\t\t|| parseFloat(duration.replace(\"ms\", \"\")\r\n\t\t\t\t.replace(\"s\", \"000\"));\r\n\t}\r\n\r\n\treturn def == null ? undefined : parseDuration(def);\r\n}\r\n\r\n/**\r\n * Validate a cache option.\r\n */\r\nexport function validateCache(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'cache' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a begin option.\r\n */\r\nexport function validateBegin(value: VelocityCallback): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'begin' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a complete option.\r\n */\r\nexport function validateComplete(value: VelocityCallback, noError?: true): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'complete' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a delay option.\r\n */\r\nexport function validateDelay(value: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed)) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'delay' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a duration option.\r\n */\r\nexport function validateDuration(value: \"fast\" | \"normal\" | \"slow\" | number, noError?: true): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'duration' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a easing option.\r\n */\r\nexport function validateEasing(value: VelocityEasingType, duration: number, noError?: true): VelocityEasingFn {\r\n\tif (isString(value)) {\r\n\t\t// Named easing\r\n\t\treturn Easings[value];\r\n\t}\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\t// TODO: We should only do these if the correct function exists - don't force loading.\r\n\tif (Array.isArray(value)) {\r\n\t\tif (value.length === 1) {\r\n\t\t\t// Steps\r\n\t\t\treturn generateStep(value[0]);\r\n\t\t}\r\n\t\tif (value.length === 2) {\r\n\t\t\t// springRK4 must be passed the animation's duration.\r\n\t\t\t// Note: If the springRK4 array contains non-numbers,\r\n\t\t\t// generateSpringRK4() returns an easing function generated with\r\n\t\t\t// default tension and friction values.\r\n\t\t\treturn generateSpringRK4(value[0], value[1], duration);\r\n\t\t}\r\n\t\tif (value.length === 4) {\r\n\t\t\t// Note: If the bezier array contains non-numbers, generateBezier()\r\n\t\t\t// returns undefined.\r\n\t\t\treturn generateBezier.apply(null, value) || false;\r\n\t\t}\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'easing' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a fpsLimit option.\r\n */\r\nexport function validateFpsLimit(value: number | false): number {\r\n\tif (value === false) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\treturn Math.min(parsed, 60);\r\n\t\t}\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'fpsLimit' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a loop option.\r\n */\r\nexport function validateLoop(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'loop' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a progress option.\r\n */\r\nexport function validateProgress(value: VelocityProgress): VelocityProgress {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'progress' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promise option.\r\n */\r\nexport function validatePromise(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promise' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promiseRejectEmpty option.\r\n */\r\nexport function validatePromiseRejectEmpty(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promiseRejectEmpty' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a queue option.\r\n */\r\nexport function validateQueue(value: string | false, noError?: true): string | false {\r\n\tif (value === false || isString(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'queue' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a repeat option.\r\n */\r\nexport function validateRepeat(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'repeat' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a speed option.\r\n */\r\nexport function validateSpeed(value: number): number {\r\n\tif (isNumber(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'speed' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a sync option.\r\n */\r\nexport function validateSync(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'sync' to an invalid value:`, value);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Velocity option defaults, which can be overriden by the user.\r\n */\r\n\r\n// Typedefs\r\nimport {StrictVelocityOptions, VelocityCallback, VelocityEasingType} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean} from \"../types\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateEasing, validateFpsLimit, validateLoop, validatePromise, validatePromiseRejectEmpty,\r\n\tvalidateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./options\";\r\n\r\n// Constants\r\nimport {\r\n\tDEFAULT_CACHE, DEFAULT_DELAY, DEFAULT_DURATION, DEFAULT_EASING, DEFAULT_FPSLIMIT,\r\n\tDEFAULT_LOOP, DEFAULT_PROMISE, DEFAULT_PROMISE_REJECT_EMPTY, DEFAULT_QUEUE, DEFAULT_REPEAT,\r\n\tDEFAULT_SPEED, DEFAULT_SYNC, FUZZY_MS_PER_SECOND,\r\n} from \"../constants\";\r\n\r\nexport const defaults: StrictVelocityOptions & {reset?: () => void} = {\r\n\tmobileHA: true,\r\n};\r\n\r\n// NOTE: Add the variable here, then add the default state in \"reset\" below.\r\nlet cache: boolean,\r\n\tbegin: VelocityCallback,\r\n\tcomplete: VelocityCallback,\r\n\tdelay: number,\r\n\tduration: number,\r\n\teasing: VelocityEasingType,\r\n\tfpsLimit: number,\r\n\tloop: number | true,\r\n\tmobileHA: boolean,\r\n\tminFrameTime: number,\r\n\tpromise: boolean,\r\n\tpromiseRejectEmpty: boolean,\r\n\tqueue: string | false,\r\n\trepeat: number | true,\r\n\tspeed: number,\r\n\tsync: boolean;\r\n\r\n// IMPORTANT: Make sure any new defaults get added to the actions/set.ts list\r\nObject.defineProperties(defaults, {\r\n\treset: {\r\n\t\tenumerable: true,\r\n\t\tvalue() {\r\n\t\t\tcache = DEFAULT_CACHE;\r\n\t\t\tbegin = undefined;\r\n\t\t\tcomplete = undefined;\r\n\t\t\tdelay = DEFAULT_DELAY;\r\n\t\t\tduration = DEFAULT_DURATION;\r\n\t\t\teasing = validateEasing(DEFAULT_EASING, DEFAULT_DURATION);\r\n\t\t\tfpsLimit = DEFAULT_FPSLIMIT;\r\n\t\t\tloop = DEFAULT_LOOP;\r\n\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / DEFAULT_FPSLIMIT;\r\n\t\t\tpromise = DEFAULT_PROMISE;\r\n\t\t\tpromiseRejectEmpty = DEFAULT_PROMISE_REJECT_EMPTY;\r\n\t\t\tqueue = DEFAULT_QUEUE;\r\n\t\t\trepeat = DEFAULT_REPEAT;\r\n\t\t\tspeed = DEFAULT_SPEED;\r\n\t\t\tsync = DEFAULT_SYNC;\r\n\t\t},\r\n\t},\r\n\tcache: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn cache;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcache = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tbegin: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn begin;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tbegin = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tcomplete: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn complete;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcomplete = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tdelay: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn delay;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tdelay = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tduration: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn duration;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tduration = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\teasing: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityEasingType {\r\n\t\t\treturn easing;\r\n\t\t},\r\n\t\tset(value: VelocityEasingType) {\r\n\t\t\tvalue = validateEasing(value, duration);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\teasing = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tfpsLimit: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn fpsLimit;\r\n\t\t},\r\n\t\tset(value: number | false) {\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tfpsLimit = value;\r\n\t\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tloop: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn loop;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tloop = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tmobileHA: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn mobileHA;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tif (isBoolean(value)) {\r\n\t\t\t\tmobileHA = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tminFrameTime: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn minFrameTime;\r\n\t\t},\r\n\t},\r\n\tpromise: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promise;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromise(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromise = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tpromiseRejectEmpty: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promiseRejectEmpty;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromiseRejectEmpty(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromiseRejectEmpty = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tqueue: {\r\n\t\tenumerable: true,\r\n\t\tget(): string | false {\r\n\t\t\treturn queue;\r\n\t\t},\r\n\t\tset(value: string | false) {\r\n\t\t\tvalue = validateQueue(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tqueue = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\trepeat: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn repeat;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\trepeat = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tspeed: {\r\n\t\tenumerable: true,\r\n\t\tget(): number {\r\n\t\t\treturn speed;\r\n\t\t},\r\n\t\tset(value: number) {\r\n\t\t\tvalue = validateSpeed(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tspeed = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tsync: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn sync;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateSync(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tsync = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n});\r\n\r\n// Reset to our default values, currently everything is undefined.\r\ndefaults.reset();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n/**\r\n * The highest type index for finding the best normalization for a property.\r\n */\r\nexport let MaxType: number = -1;\r\n\r\n/**\r\n * Unlike \"actions\", normalizations can always be replaced by users.\r\n */\r\nexport const Normalizations: {[name: string]: VelocityNormalizationsFn}[] = [];\r\n\r\n/**\r\n * Store a cross-reference to units to be added to specific normalization\r\n * functions if the user supplies a unit-less number.\r\n *\r\n * This is pretty much confined to adding \"px\" to several css properties.\r\n */\r\nexport const NormalizationUnits: {[unit: string]: VelocityNormalizationsFn[]} = {};\r\n\r\n/**\r\n * Any normalisations that should never be cached are listed here.\r\n * Faster than an array - https://jsperf.com/array-includes-and-find-methods-vs-set-has\r\n */\r\nexport const NoCacheNormalizations = new Set();\r\n\r\n/**\r\n * Used to define a constructor.\r\n */\r\nexport interface ClassConstructor {\r\n\tnew(): object;\r\n}\r\n\r\n/**\r\n * An array of classes used for the per-class normalizations. This\r\n * translates into a bitwise enum for quick cross-reference, and so that\r\n * the element doesn't need multiple instanceof calls every\r\n * frame.\r\n */\r\nexport const constructors: (ClassConstructor | string)[] = [];\r\n\r\n/**\r\n * A cache of the various constructors we've found and mapping to their real\r\n * name - saves expensive lookups.\r\n */\r\nexport const constructorCache = new Map();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {ElementData, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {constructors} from \"./normalizations/normalizationsObject\";\r\n\r\n// Constants\r\nconst dataName = \"velocityData\";\r\n\r\n/**\r\n * Get (and create) the internal data store for an element.\r\n */\r\nexport function Data(element: HTMLorSVGElement): ElementData {\r\n\t// Use a string member so Uglify doesn't mangle it.\r\n\tconst data = element[dataName];\r\n\r\n\tif (data) {\r\n\t\treturn data;\r\n\t}\r\n\tconst window = element.ownerDocument.defaultView;\r\n\tlet types = 0;\r\n\r\n\tfor (let index = 0; index < constructors.length; index++) {\r\n\t\tconst constructor = constructors[index];\r\n\r\n\t\tif (isString(constructor)) {\r\n\t\t\tif (element instanceof window[constructor]) {\r\n\t\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t} else if (element instanceof constructor) {\r\n\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n\t// Use an intermediate object so it errors on incorrect data.\r\n\tconst newData: ElementData = {\r\n\t\ttypes,\r\n\t\tcount: 0,\r\n\t\tcomputedStyle: null,\r\n\t\tcache: {} as any,\r\n\t\tqueueList: {},\r\n\t\tlastAnimationList: {},\r\n\t\tlastFinishList: {},\r\n\t\twindow,\r\n\t};\r\n\r\n\tObject.defineProperty(element, dataName, {\r\n\t\tvalue: newData,\r\n\t});\r\n\r\n\treturn newData;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityState} from \"../../velocity.d\";\r\n\r\n// Constants\r\nimport {CLASSNAME} from \"../constants\";\r\n\r\nconst isClient = window && window === window.window,\r\n\twindowScrollAnchor = isClient && window.pageYOffset !== undefined;\r\n\r\nexport const State: VelocityState = {\r\n\tisClient,\r\n\tisMobile: isClient && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\r\n\tisAndroid: isClient && /Android/i.test(navigator.userAgent),\r\n\tisGingerbread: isClient && /Android 2\\.3\\.[3-7]/i.test(navigator.userAgent),\r\n\tisChrome: isClient && (window as any).chrome,\r\n\tisFirefox: isClient && /Firefox/i.test(navigator.userAgent),\r\n\tprefixElement: isClient && document.createElement(\"div\"),\r\n\twindowScrollAnchor,\r\n\tscrollAnchor: windowScrollAnchor ? window : (!isClient || document.documentElement || document.body.parentNode || document.body),\r\n\tscrollPropertyLeft: windowScrollAnchor ? \"pageXOffset\" : \"scrollLeft\",\r\n\tscrollPropertyTop: windowScrollAnchor ? \"pageYOffset\" : \"scrollTop\",\r\n\tclassName: CLASSNAME,\r\n\tisTicking: false,\r\n\tfirst: undefined,\r\n\tlast: undefined,\r\n\tfirstNew: undefined,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * AnimationCall queue\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {addClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Simple queue management. Un-named queue is directly within the element data,\r\n * named queue is within an object within it.\r\n */\r\nfunction animate(animation: AnimationCall) {\r\n\tconst prev = State.last;\r\n\r\n\tanimation._prev = prev;\r\n\tanimation._next = undefined;\r\n\tif (prev) {\r\n\t\tprev._next = animation;\r\n\t} else {\r\n\t\tState.first = animation;\r\n\t}\r\n\tState.last = animation;\r\n\tif (!State.firstNew) {\r\n\t\tState.firstNew = animation;\r\n\t}\r\n\tconst element = animation.element,\r\n\t\tdata = Data(element);\r\n\r\n\tif (!data.count++) {\r\n\r\n\t\t////////////////////////\r\n\t\t// Feature: Classname //\r\n\t\t////////////////////////\r\n\r\n\t\taddClass(element, State.className);\r\n\t}\r\n}\r\n\r\n/**\r\n * Add an item to an animation queue.\r\n */\r\nexport function queue(element: HTMLorSVGElement, animation: AnimationCall, queueName: string | false): void {\r\n\tconst data = Data(element);\r\n\r\n\tif (queueName !== false) {\r\n\t\t// Store the last animation added so we can use it for the\r\n\t\t// beginning of the next one.\r\n\t\tdata.lastAnimationList[queueName] = animation;\r\n\t}\r\n\tif (queueName === false) {\r\n\t\tanimate(animation);\r\n\t} else {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tlet last = data.queueList[queueName];\r\n\r\n\t\tif (!last) {\r\n\t\t\tif (last === null) {\r\n\t\t\t\tdata.queueList[queueName] = animation;\r\n\t\t\t} else {\r\n\t\t\t\tdata.queueList[queueName] = null;\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twhile (last._next) {\r\n\t\t\t\tlast = last._next;\r\n\t\t\t}\r\n\t\t\tlast._next = animation;\r\n\t\t\tanimation._prev = last;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Start the next animation on this element's queue (named or default).\r\n *\r\n * @returns the next animation that is starting.\r\n */\r\nexport function dequeue(element: HTMLorSVGElement, queueName?: string | boolean, skip?: boolean): AnimationCall {\r\n\tif (queueName !== false) {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tconst data = Data(element),\r\n\t\t\tanimation = data.queueList[queueName];\r\n\r\n\t\tif (animation) {\r\n\t\t\tdata.queueList[queueName] = animation._next || null;\r\n\t\t\tif (!skip) {\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else if (animation === null) {\r\n\t\t\tdelete data.queueList[queueName];\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t}\r\n}\r\n\r\n/**\r\n * Remove an animation from the active animation list. If it has a queue set\r\n * then remember it as the last animation for that queue, and free the one\r\n * that was previously there. If the animation list is completely empty then\r\n * mark us as finished.\r\n */\r\nexport function freeAnimationCall(animation: AnimationCall): void {\r\n\tconst next = animation._next,\r\n\t\tprev = animation._prev,\r\n\t\tqueueName = animation.queue == null ? animation.options.queue : animation.queue;\r\n\r\n\tif (State.firstNew === animation) {\r\n\t\tState.firstNew = next;\r\n\t}\r\n\tif (State.first === animation) {\r\n\t\tState.first = next;\r\n\t} else if (prev) {\r\n\t\tprev._next = next;\r\n\t}\r\n\tif (State.last === animation) {\r\n\t\tState.last = prev;\r\n\t} else if (next) {\r\n\t\tnext._prev = prev;\r\n\t}\r\n\tif (queueName) {\r\n\t\tconst data = Data(animation.element);\r\n\r\n\t\tif (data) {\r\n\t\t\tanimation._next = animation._prev = undefined;\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Call Completion\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityCallback} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {getValue, removeClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {dequeue, freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Call the complete method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callComplete(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.complete as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Complete an animation. This might involve restarting (for loop or repeat\r\n * options). Once it is finished we also check for any callbacks or Promises\r\n * that need updating.\r\n */\r\nexport function completeCall(activeCall: AnimationCall) {\r\n\t// TODO: Check if it's not been completed already\r\n\tconst options = activeCall.options,\r\n\t\tqueue = getValue(activeCall.queue, options.queue),\r\n\t\tisLoop = getValue(activeCall.loop, options.loop, defaults.loop),\r\n\t\tisRepeat = getValue(activeCall.repeat, options.repeat, defaults.repeat),\r\n\t\tisStopped = activeCall._flags & AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\r\n\tif (!isStopped && (isLoop || isRepeat)) {\r\n\r\n\t\t////////////////////\r\n\t\t// Option: Loop //\r\n\t\t// Option: Repeat //\r\n\t\t////////////////////\r\n\r\n\t\tif (isRepeat && isRepeat !== true) {\r\n\t\t\tactiveCall.repeat = isRepeat - 1;\r\n\t\t} else if (isLoop && isLoop !== true) {\r\n\t\t\tactiveCall.loop = isLoop - 1;\r\n\t\t\tactiveCall.repeat = getValue(activeCall.repeatAgain, options.repeatAgain, defaults.repeatAgain);\r\n\t\t}\r\n\t\tif (isLoop) {\r\n\t\t\tactiveCall._flags ^= AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\tif (queue !== false) {\r\n\t\t\t// Can't be called when stopped so no need for an extra check.\r\n\t\t\tData(activeCall.element).lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t}\r\n\t\tactiveCall.timeStart = activeCall.ellapsedTime = activeCall.percentComplete = 0;\r\n\t\tactiveCall._flags &= ~AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t} else {\r\n\t\tconst element = activeCall.element,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (!--data.count && !isStopped) {\r\n\r\n\t\t\t////////////////////////\r\n\t\t\t// Feature: Classname //\r\n\t\t\t////////////////////////\r\n\r\n\t\t\tremoveClass(element, State.className);\r\n\t\t}\r\n\r\n\t\t//////////////////////\r\n\t\t// Option: Complete //\r\n\t\t//////////////////////\r\n\r\n\t\t// If this is the last animation in this list then we can check for\r\n\t\t// and complete calls or Promises.\r\n\t\t// TODO: When deleting an element we need to adjust these values.\r\n\t\tif (options && ++options._completed === options._total) {\r\n\t\t\tif (!isStopped && options.complete) {\r\n\t\t\t\t// We don't call the complete if the animation is stopped,\r\n\t\t\t\t// and we clear the key to prevent it being called again.\r\n\t\t\t\tcallComplete(activeCall);\r\n\t\t\t\toptions.complete = null;\r\n\t\t\t}\r\n\t\t\tconst resolver = options._resolver;\r\n\r\n\t\t\tif (resolver) {\r\n\t\t\t\t// Fulfil the Promise\r\n\t\t\t\tresolver(activeCall.elements as any);\r\n\t\t\t\tdelete options._resolver;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t///////////////////\r\n\t\t// Option: Queue //\r\n\t\t///////////////////\r\n\r\n\t\tif (queue !== false) {\r\n\t\t\t// We only do clever things with queues...\r\n\t\t\tif (!isStopped) {\r\n\t\t\t\t// If we're not stopping an animation, we need to remember\r\n\t\t\t\t// what time it finished so that the next animation in\r\n\t\t\t\t// sequence gets the correct start time.\r\n\t\t\t\tdata.lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t\t}\r\n\t\t\t// Start the next animation in sequence, or delete the queue if\r\n\t\t\t// this was the last one.\r\n\t\t\tdequeue(element, queue);\r\n\t\t}\r\n\t\t// Cleanup any pointers, and remember the last animation etc.\r\n\t\tfreeAnimationCall(activeCall);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\nimport {Data} from \"../data\";\r\nimport {ClassConstructor, constructorCache, constructors, NoCacheNormalizations, Normalizations, NormalizationUnits} from \"./normalizationsObject\";\r\n\r\n/**\r\n * Used to register a normalization. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerNormalization\", \"Element\", \"name\", VelocityNormalizationsFn[, false]);\r\n *\r\n * The second argument is the class of the animatable object. If this is passed\r\n * as a class name (ie, `\"Element\"` -> `window[\"Element\"]`) then this will work\r\n * cross-iframe. If passed as an actual class (ie `Element`) then it will\r\n * attempt to find the class on the window and use that name instead. If it\r\n * can't find it then it will use the class passed, which allows for custom\r\n * animation targets, but will not work cross-iframe boundary.\r\n *\r\n * The fourth argument can be an explicit false, which prevents\r\n * the property from being cached. Please note that this can be dangerous\r\n * for performance!\r\n */\r\nexport function registerNormalization(\r\n\targs?: [ClassConstructor | string, string, VelocityNormalizationsFn]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, boolean]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string, boolean]) {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1],\r\n\t\tcallback = args[2];\r\n\r\n\tif ((isString(constructor) && !(window[constructor] instanceof Object))\r\n\t\t|| (!isString(constructor) && !(constructor instanceof Object))) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' constructor to an invalid value:`, constructor);\r\n\t} else if (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' callback to an invalid value:`, name, callback);\r\n\t} else {\r\n\t\tlet index = constructors.indexOf(constructor),\r\n\t\t\tnextArg = 3;\r\n\r\n\t\tif (index < 0 && !isString(constructor)) {\r\n\t\t\tif (constructorCache.has(constructor)) {\r\n\t\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t\t} else {\r\n\t\t\t\tfor (const property in window) {\r\n\t\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t\t\tindex = constructors.push(property) - 1;\r\n\t\t\t\t\t\t\tNormalizations[index] = {};\r\n\t\t\t\t\t\t\tconstructorCache.set(constructor, property);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (index < 0) {\r\n\t\t\tindex = constructors.push(constructor) - 1;\r\n\t\t\tNormalizations[index] = {};\r\n\t\t}\r\n\t\tNormalizations[index][name] = callback;\r\n\t\tif (isString(args[nextArg])) {\r\n\t\t\tconst unit = args[nextArg++] as string;\r\n\t\t\tlet units = NormalizationUnits[unit];\r\n\r\n\t\t\tif (!units) {\r\n\t\t\t\tunits = NormalizationUnits[unit] = [];\r\n\t\t\t}\r\n\t\t\tunits.push(callback);\r\n\t\t}\r\n\t\tif (args[nextArg] === false) {\r\n\t\t\tNoCacheNormalizations.add(name);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to check if a normalisation exists on a specific class.\r\n */\r\nexport function hasNormalization(args?: [ClassConstructor | string, string]): boolean {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1];\r\n\tlet index = constructors.indexOf(constructor);\r\n\r\n\tif (index < 0 && !isString(constructor)) {\r\n\t\tif (constructorCache.has(constructor)) {\r\n\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t} else {\r\n\t\t\tfor (const property in window) {\r\n\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn index >= 0 && Normalizations[index].hasOwnProperty(name);\r\n}\r\n\r\n/**\r\n * Get the unit to add to a unitless number based on the normalization used.\r\n */\r\nexport function getNormalizationUnit(fn: VelocityNormalizationsFn) {\r\n\tfor (const unit in NormalizationUnits) {\r\n\t\tif (NormalizationUnits[unit].includes(fn)) {\r\n\t\t\treturn unit;\r\n\t\t}\r\n\t}\r\n\r\n\treturn \"\";\r\n}\r\n\r\n/**\r\n * Get the normalization for an element and propertyName combination. This\r\n * value should be cached at asking time, as it may change if the user adds\r\n * more normalizations.\r\n */\r\nexport function getNormalization(element: HTMLorSVGElement, propertyName: string) {\r\n\tconst data = Data(element);\r\n\tlet fn: VelocityNormalizationsFn;\r\n\r\n\tfor (let index = constructors.length - 1, types = data.types; !fn && index >= 0; index--) {\r\n\t\tif (types & (1 << index)) { // tslint:disable-line:no-bitwise\r\n\t\t\tfn = Normalizations[index][propertyName];\r\n\t\t}\r\n\t}\r\n\r\n\treturn fn;\r\n}\r\n\r\nregisterAction([\"registerNormalization\", registerNormalization]);\r\nregisterAction([\"hasNormalization\", hasNormalization]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\n\r\n/**\r\n * The singular setPropertyValue, which routes the logic for all\r\n * normalizations.\r\n */\r\nexport function setPropertyValue(element: HTMLorSVGElement, propertyName: string, propertyValue: any, fn?: VelocityNormalizationsFn) {\r\n\tconst noCache = NoCacheNormalizations.has(propertyName),\r\n\t\tdata = !noCache && Data(element);\r\n\r\n\tif (noCache || (data && data.cache[propertyName] !== propertyValue)) {\r\n\t\t// By setting it to undefined we force a true \"get\" later\r\n\t\tif (!noCache) {\r\n\t\t\tdata.cache[propertyName] = propertyValue || undefined;\r\n\t\t}\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tfn(element, propertyValue);\r\n\t\t}\r\n\t\tif (Velocity.debug >= 2) {\r\n\t\t\tconsole.info(`Set \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n/**\r\n * Cache every camelCase match to avoid repeating lookups.\r\n */\r\nconst cache: {[property: string]: string} = {};\r\n\r\n/**\r\n * Camelcase a property name into its JavaScript notation (e.g.\r\n * \"background-color\" ==> \"backgroundColor\"). Camelcasing is used to\r\n * normalize property names between and across calls.\r\n */\r\nexport function camelCase(property: string): string {\r\n\tconst fixed = cache[property];\r\n\r\n\tif (fixed) {\r\n\t\treturn fixed;\r\n\t}\r\n\r\n\treturn cache[property] = property.replace(/-([a-z])/g, ($: string, letter: string) => letter.toUpperCase());\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Constants\r\nconst rxColor6 = /#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/gi,\r\n\trxColor3 = /#([a-f\\d])([a-f\\d])([a-f\\d])/gi,\r\n\trxColorName = /(rgba?\\(\\s*)?(\\b[a-z]+\\b)/g,\r\n\trxRGB = /rgb(a?)\\(([^\\)]+)\\)/gi,\r\n\trxSpaces = /\\s+/g;\r\n\r\n/**\r\n * This is the list of color names -> rgb values. The object is in here so\r\n * that the actual name conversion can be in a separate file and not\r\n * included for custom builds.\r\n */\r\nexport const ColorNames: {[name: string]: string} = {};\r\n\r\n/**\r\n * Convert a hex list to an rgba value. Designed to be used in replace.\r\n */\r\nfunction makeRGBA(ignore: any, r: string, g: string, b: string): string {\r\n\treturn `rgba(${parseInt(r, 16)},${parseInt(g, 16)},${parseInt(b, 16)},1)`;\r\n}\r\n\r\n/**\r\n * Replace any css colour name with its rgba() value. It is possible to use\r\n * the name within an \"rgba(blue, 0.4)\" string this way.\r\n */\r\nexport function fixColors(str: string): string {\r\n\treturn str\r\n\t\t.replace(rxColor6, makeRGBA)\r\n\t\t.replace(rxColor3, ($0, r, g, b) => {\r\n\t\t\treturn makeRGBA($0, r + r, g + g, b + b);\r\n\t\t})\r\n\t\t.replace(rxColorName, ($0, $1, $2) => {\r\n\t\t\tif (ColorNames[$2]) {\r\n\t\t\t\treturn ($1 ? $1 : \"rgba(\") + ColorNames[$2] + ($1 ? \"\" : \",1)\");\r\n\t\t\t}\r\n\r\n\t\t\treturn $0;\r\n\t\t})\r\n\t\t.replace(rxRGB, ($0, $1, $2: string) => {\r\n\t\t\treturn `rgba(${$2.replace(rxSpaces, \"\") + ($1 ? \"\" : \",1\")})`;\r\n\t\t});\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"./getPropertyValue\";\r\n\r\n/**\r\n * Figure out the dimensions for this width / height based on the\r\n * potential borders and whether we care about them.\r\n */\r\nexport function augmentDimension(element: HTMLorSVGElement, name: \"width\" | \"height\", wantInner: boolean): number {\r\n\tconst isBorderBox = getPropertyValue(element, \"boxSizing\")\r\n\t\t.toString()\r\n\t\t.toLowerCase() === \"border-box\";\r\n\r\n\tif (isBorderBox === wantInner) {\r\n\t\t// in box-sizing mode, the CSS width / height accessors already\r\n\t\t// give the outerWidth / outerHeight.\r\n\t\tconst sides = name === \"width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\r\n\t\t\tfields = [`padding${sides[0]}`, `padding${sides[1]}`, `border${sides[0]}Width`, `border${sides[1]}Width`];\r\n\t\tlet augment = 0;\r\n\r\n\t\tfor (const field of fields) {\r\n\t\t\tconst value = parseFloat(getPropertyValue(element, field));\r\n\r\n\t\t\tif (!isNaN(value)) {\r\n\t\t\t\taugment += value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn wantInner ? -augment : augment;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\nimport {augmentDimension} from \"./augmentDimension\";\r\nimport {setPropertyValue} from \"./setPropertyValue\";\r\n\r\n/**\r\n * Get the width or height of an element, pulled out as it can be used when the\r\n * in two locations so don't want to repeat it.\r\n */\r\nfunction getWidthHeight(element: HTMLorSVGElement, property: \"width\" | \"height\"): string {\r\n\treturn (element.getBoundingClientRect()[property] + augmentDimension(element, property, true)) + \"px\";\r\n}\r\n\r\n// TODO: This is still a complete mess\r\nexport function computePropertyValue(element: HTMLorSVGElement, property: string): string {\r\n\tconst data = Data(element),\r\n\t\t// If computedStyle is cached, use it. If not then get the correct one\r\n\t\t// for the element to support cross-iframe boundaries.\r\n\t\tcomputedStyle = data.computedStyle ? data.computedStyle : data.window.getComputedStyle(element, null);\r\n\tlet computedValue: string | number = 0;\r\n\r\n\tif (!data.computedStyle) {\r\n\t\tdata.computedStyle = computedStyle;\r\n\t}\r\n\tif (computedStyle[\"display\"] === \"none\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\t// Browsers do not return height and width values for elements\r\n\t\t\t\t// that are set to display:\"none\". Thus, we temporarily toggle\r\n\t\t\t\t// display to the element type's default value.\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"auto\");\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"none\");\r\n\r\n\t\t\t\treturn String(computedValue);\r\n\t\t}\r\n\t}\r\n\r\n\t/* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\r\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\r\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\r\n\t/* TODO: There is a borderColor normalisation in legacy/ - figure out where this is needed... */\r\n\r\n\tcomputedValue = computedStyle[property];\r\n\t/* Fall back to the property's style value (if defined) when computedValue returns nothing,\r\n\t which can happen when the element hasn't been painted. */\r\n\tif (!computedValue) {\r\n\t\tcomputedValue = element.style[property];\r\n\t}\r\n\t/* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\r\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\r\n\t effect as being set to 0, so no conversion is necessary.) */\r\n\t/* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\r\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\r\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\r\n\tif (computedValue === \"auto\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"top\":\r\n\t\t\tcase \"left\":\r\n\t\t\t\tconst topLeft = true;\r\n\t\t\tcase \"right\":\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tconst position = getPropertyValue(element, \"position\");\r\n\r\n\t\t\t\tif (position === \"fixed\" || (topLeft && position === \"absolute\")) {\r\n\t\t\t\t\t// Note: this has no pixel unit on its returned values,\r\n\t\t\t\t\t// we re-add it here to conform with\r\n\t\t\t\t\t// computePropertyValue's behavior.\r\n\t\t\t\t\tcomputedValue = element.getBoundingClientRect[property] + \"px\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t// Deliberate fallthrough!\r\n\t\t\tdefault:\r\n\t\t\t\tcomputedValue = \"0px\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn computedValue ? String(computedValue) : \"\";\r\n}\r\n\r\n/**\r\n * Get a property value. This will grab via the cache if it exists, then\r\n * via any normalisations.\r\n */\r\nexport function getPropertyValue(element: HTMLorSVGElement, propertyName: string, fn?: VelocityNormalizationsFn, skipCache?: boolean): string {\r\n\tconst data = Data(element);\r\n\tlet propertyValue: string;\r\n\r\n\tif (NoCacheNormalizations.has(propertyName)) {\r\n\t\tskipCache = true;\r\n\t}\r\n\tif (!skipCache && data && data.cache[propertyName] != null) {\r\n\t\tpropertyValue = data.cache[propertyName];\r\n\t} else {\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tpropertyValue = fn(element);\r\n\t\t\tif (data) {\r\n\t\t\t\tdata.cache[propertyName] = propertyValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (Velocity.debug >= 2) {\r\n\t\tconsole.info(`Get \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t}\r\n\r\n\treturn propertyValue;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tweens\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, Sequence,\r\n\tVelocityProperty, VelocityPropertyFn, VelocityPropertyValueFn, VelocityTween,\r\n} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isNumber, isString} from \"../types\";\r\nimport {cloneArray, getValue} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {fixColors} from \"./css/fixColors\";\r\nimport {getPropertyValue} from \"./css/getPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {getNormalization, getNormalizationUnit} from \"./normalizations/normalizations\";\r\nimport {validateEasing} from \"./options\";\r\nimport {State} from \"./state\";\r\n\r\n// Constants\r\nconst rxHex = /^#([A-f\\d]{3}){1,2}$/i,\r\n\tcommands: {\r\n\t\t[type: string]: (\r\n\t\t\tvalue: any,\r\n\t\t\telement: HTMLorSVGElement,\r\n\t\t\telements: HTMLorSVGElement[],\r\n\t\t\telementArrayIndex: number,\r\n\t\t\tpropertyName: string,\r\n\t\t\ttween: VelocityTween) => string;\r\n\t} = {\r\n\t\t\tfunction: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn (value as any as VelocityPropertyValueFn).call(element, elementArrayIndex, elements.length);\r\n\t\t\t},\r\n\t\t\tnumber: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn String(value) + getNormalizationUnit(tween.fn);\r\n\t\t\t},\r\n\t\t\tstring: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(value);\r\n\t\t\t},\r\n\t\t\tundefined: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(getPropertyValue(element, propertyName, tween.fn) || \"\");\r\n\t\t\t},\r\n\t\t};\r\n\r\n/**\r\n * Expand a VelocityProperty argument into a valid sparse Tween array. This\r\n * pre-allocates the array as it is then the correct size and slightly\r\n * faster to access.\r\n */\r\nexport function expandProperties(animation: AnimationCall, properties: Properties) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telements = animation.elements,\r\n\t\telement = animation.element,\r\n\t\telementArrayIndex = elements.indexOf(element),\r\n\t\tdata = Data(element),\r\n\t\tqueue = getValue(animation.queue, animation.options.queue),\r\n\t\tduration = getValue(animation.options.duration, defaults.duration);\r\n\r\n\tfor (const property in properties) {\r\n\t\tif (properties.hasOwnProperty(property)) {\r\n\t\t\tconst propertyName = camelCase(property),\r\n\t\t\t\tfn = getNormalization(element, propertyName);\r\n\t\t\tlet valueData = properties[property];\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (valueData == null) {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to no value supplied.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst tween: VelocityTween = tweens[propertyName] = {} as any;\r\n\t\t\tlet endValue: string,\r\n\t\t\t\tstartValue: string;\r\n\r\n\t\t\ttween.fn = fn;\r\n\t\t\tif (isFunction(valueData)) {\r\n\t\t\t\t// If we have a function as the main argument then resolve\r\n\t\t\t\t// it first, in case it returns an array that needs to be\r\n\t\t\t\t// split.\r\n\t\t\t\tvalueData = (valueData as VelocityPropertyFn).call(element, elementArrayIndex, elements.length, elements);\r\n\t\t\t}\r\n\t\t\tif (Array.isArray(valueData)) {\r\n\t\t\t\t// valueData is an array in the form of\r\n\t\t\t\t// [ endValue, [, easing] [, startValue] ]\r\n\t\t\t\tconst arr1 = valueData[1],\r\n\t\t\t\t\tarr2 = valueData[2];\r\n\r\n\t\t\t\tendValue = valueData[0] as any;\r\n\t\t\t\tif ((isString(arr1) && (/^[\\d-]/.test(arr1) || rxHex.test(arr1))) || isFunction(arr1) || isNumber(arr1)) {\r\n\t\t\t\t\tstartValue = arr1 as any;\r\n\t\t\t\t} else if ((isString(arr1) && Easings[arr1]) || Array.isArray(arr1)) {\r\n\t\t\t\t\ttween.easing = validateEasing(arr1, duration);\r\n\t\t\t\t\tstartValue = arr2 as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstartValue = arr1 || arr2 as any;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tendValue = valueData as any;\r\n\t\t\t}\r\n\t\t\ttween.end = commands[typeof endValue](endValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\tif (startValue != null || (queue === false || data.queueList[queue] === undefined)) {\r\n\t\t\t\ttween.start = commands[typeof startValue](startValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// TODO: Needs a better match for \"translate3d\" etc - a number must be preceded by some form of break...\r\nconst rxToken = /((?:[+\\-*/]=)?(?:[+-]?\\d*\\.\\d+|[+-]?\\d+)[a-z%]*|(?:.(?!$|[+-]?\\d|[+\\-*/]=[+-]?\\d))+.|.)/g,\r\n\trxNumber = /^([+\\-*/]=)?([+-]?\\d*\\.\\d+|[+-]?\\d+)(.*)$/;\r\n\r\n/**\r\n * Find a pattern between multiple strings, return a VelocitySequence with\r\n * the pattern and the tokenised values.\r\n *\r\n * If number then animate.\r\n * If a string then must match.\r\n * If units then convert between them by wrapping in a calc().\r\n * - If already in a calc then nest another layer.\r\n * If in an rgba() then the first three numbers are rounded.\r\n */\r\nexport function findPattern(parts: ReadonlyArray, propertyName: string): Sequence {\r\n\tconst partsLength = parts.length,\r\n\t\ttokens: string[][] = [],\r\n\t\tindexes: number[] = [];\r\n\tlet numbers: boolean;\r\n\r\n\t// First tokenise the strings - these have all values, we will pull\r\n\t// numbers later.\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tif (isString(parts[part])) {\r\n\t\t\ttokens[part] = cloneArray(parts[part].match(rxToken));\r\n\t\t\tindexes[part] = 0;\r\n\t\t\t// If it matches more than one thing then we've got a number.\r\n\t\t\tnumbers = numbers || tokens[part].length > 1;\r\n\t\t\t//console.log(`tokens:`, parts[part], tokens[part])\r\n\t\t} else {\r\n\t\t\t// We have an incomplete lineup, it will get tried again later...\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tconst sequence: Sequence = [] as any,\r\n\t\tpattern = (sequence.pattern = []) as (string | boolean)[],\r\n\t\taddString = (text: string) => {\r\n\t\t\tif (isString(pattern[pattern.length - 1])) {\r\n\t\t\t\tpattern[pattern.length - 1] += text;\r\n\t\t\t} else if (text) {\r\n\t\t\t\tpattern.push(text);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\treturnStringType = () => {\r\n\t\t\tif (numbers || pattern.length > 1) {\r\n\t\t\t\t//console.error(`Velocity: Trying to pattern match mis-matched strings \"${propertyName}\":`, parts);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst isDisplay = propertyName === \"display\",\r\n\t\t\t\tisVisibility = propertyName === \"visibility\";\r\n\r\n\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\tconst value = parts[part];\r\n\r\n\t\t\t\tsequence[part][0] = value;\r\n\t\t\t\t// Don't care about duration...\r\n\t\t\t\tsequence[part].easing = validateEasing((isDisplay && value === \"none\") || (isVisibility && value === \"hidden\") || (!isDisplay && !isVisibility) ? \"at-end\" : \"at-start\", 400);\r\n\t\t\t}\r\n\t\t\tpattern[0] = false;\r\n\r\n\t\t\treturn sequence;\r\n\t\t};\r\n\tlet more = true;\r\n\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tsequence[part] = [];\r\n\t}\r\n\twhile (more) {\r\n\t\tconst bits: ([number, string] | [number, string, boolean])[] = [],\r\n\t\t\tunits: string[] = [];\r\n\t\tlet text: string,\r\n\t\t\tisUnitless = false,\r\n\t\t\thasNumbers = false;\r\n\r\n\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\tconst index = indexes[part]++,\r\n\t\t\t\ttoken = tokens[part][index];\r\n\r\n\t\t\tif (token) {\r\n\t\t\t\tconst num = token.match(rxNumber); // [ignore, change, number, unit]\r\n\r\n\t\t\t\tif (num) {\r\n\t\t\t\t\t// It's a number, possibly with a += change and unit.\r\n\t\t\t\t\tif (text) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst digits = parseFloat(num[2]),\r\n\t\t\t\t\t\tunit = num[3],\r\n\t\t\t\t\t\tchange = num[1] ? num[1][0] + unit : undefined,\r\n\t\t\t\t\t\tchangeOrUnit = change || unit;\r\n\r\n\t\t\t\t\tif (!units.includes(changeOrUnit)) {\r\n\t\t\t\t\t\t// Will be an empty string at the least.\r\n\t\t\t\t\t\tunits.push(changeOrUnit);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!unit) {\r\n\t\t\t\t\t\tif (digits) {\r\n\t\t\t\t\t\t\thasNumbers = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tisUnitless = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbits[part] = change ? [digits, changeOrUnit, true] : [digits, changeOrUnit];\r\n\t\t\t\t} else if (bits.length) {\r\n\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// It's a string.\r\n\t\t\t\t\tif (!text) {\r\n\t\t\t\t\t\ttext = token;\r\n\t\t\t\t\t} else if (text !== token) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!part) {\r\n\t\t\t\tfor (; part < partsLength; part++) {\r\n\t\t\t\t\tconst index2 = indexes[part]++;\r\n\r\n\t\t\t\t\tif (tokens[part][index2]) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// IMPORTANT: This is the exit point.\r\n\t\t\t\tmore = false;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t// Different\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (text) {\r\n\t\t\taddString(text);\r\n\t\t} else if (units.length) {\r\n\t\t\tif (units.length === 2 && isUnitless && !hasNumbers) {\r\n\t\t\t\t// If we only have two units, and one is empty, and it's only empty on \"0\", then treat us as having one unit\r\n\t\t\t\tunits.splice(units[0] ? 1 : 0, 1);\r\n\t\t\t}\r\n\t\t\tif (units.length === 1) {\r\n\t\t\t\t// All the same units, so append number then unit.\r\n\t\t\t\tconst unit = units[0],\r\n\t\t\t\t\tfirstLetter = unit[0];\r\n\r\n\t\t\t\tswitch (firstLetter) {\r\n\t\t\t\t\tcase \"+\":\r\n\t\t\t\t\tcase \"-\":\r\n\t\t\t\t\tcase \"*\":\r\n\t\t\t\t\tcase \"/\":\r\n\t\t\t\t\t\tif (propertyName) {\r\n\t\t\t\t\t\t\tconsole.error(`Velocity: The first property must not contain a relative function \"${propertyName}\":`, parts);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tpattern.push(false);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(bits[part][0]);\r\n\t\t\t\t}\r\n\t\t\t\taddString(unit);\r\n\t\t\t} else {\r\n\t\t\t\t// Multiple units, so must be inside a calc.\r\n\t\t\t\taddString(\"calc(\");\r\n\t\t\t\tconst patternCalc = pattern.length - 1; // Store the beginning of our calc.\r\n\r\n\t\t\t\tfor (let i = 0; i < units.length; i++) {\r\n\t\t\t\t\tconst unit = units[i],\r\n\t\t\t\t\t\tfirstLetter = unit[0],\r\n\t\t\t\t\t\tisComplex = firstLetter === \"*\" || firstLetter === \"/\",\r\n\t\t\t\t\t\tisMaths = isComplex || firstLetter === \"+\" || firstLetter === \"-\";\r\n\r\n\t\t\t\t\tif (isComplex) {\r\n\t\t\t\t\t\t// TODO: Not sure this should be done automatically!\r\n\t\t\t\t\t\tpattern[patternCalc] += \"(\";\r\n\t\t\t\t\t\taddString(\")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i) {\r\n\t\t\t\t\t\taddString(` ${isMaths ? firstLetter : \"+\"} `);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpattern.push(false);\r\n\t\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t\tconst bit = bits[part],\r\n\t\t\t\t\t\t\tvalue = bit[1] === unit\r\n\t\t\t\t\t\t\t\t? bit[0]\r\n\t\t\t\t\t\t\t\t: bit.length === 3\r\n\t\t\t\t\t\t\t\t\t? sequence[part - 1][sequence[part - 1].length - 1]\r\n\t\t\t\t\t\t\t\t\t: isComplex ? 1 : 0;\r\n\r\n\t\t\t\t\t\t(sequence[part] as any[]).push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\taddString(isMaths ? unit.substring(1) : unit);\r\n\t\t\t\t}\r\n\t\t\t\taddString(\")\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// We've got here, so a valid sequence - now check and fix RGB rounding\r\n\t// and calc() nesting...\r\n\t// TODO: Nested calc(a + calc(b + c)) -> calc(a + (b + c))\r\n\tfor (let i = 0, inRGB = 0; i < pattern.length; i++) {\r\n\t\tconst text = pattern[i];\r\n\r\n\t\tif (isString(text)) {\r\n\t\t\tif (inRGB && (text as string).indexOf(\",\") >= 0) {\r\n\t\t\t\tinRGB++;\r\n\t\t\t} else if ((text as string).indexOf(\"rgb\") >= 0) {\r\n\t\t\t\tinRGB = 1;\r\n\t\t\t}\r\n\t\t} else if (inRGB) {\r\n\t\t\tif (inRGB < 4) {\r\n\t\t\t\tpattern[i] = true;\r\n\t\t\t} else {\r\n\t\t\t\tinRGB = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn sequence;\r\n}\r\n\r\n/**\r\n * Convert a string-based tween with start and end strings, into a pattern\r\n * based tween with arrays.\r\n */\r\nfunction explodeTween(propertyName: string, tween: VelocityTween, duration: number, starting?: boolean) {\r\n\tconst startValue: string = tween.start,\r\n\t\tendValue: string = tween.end;\r\n\r\n\tif (!isString(endValue) || !isString(startValue)) {\r\n\t\treturn;\r\n\t}\r\n\tlet sequence: Sequence = findPattern([startValue, endValue], propertyName);\r\n\r\n\tif (!sequence && starting) {\r\n\t\t// This little piece will take a startValue, split out the\r\n\t\t// various numbers in it, then copy the endValue into the\r\n\t\t// startValue while replacing the numbers in it to match the\r\n\t\t// original start numbers as a repeating sequence.\r\n\t\t// Finally this function will run again with the new\r\n\t\t// startValue and a now matching pattern.\r\n\t\tconst startNumbers = startValue.match(/\\d\\.?\\d*/g) || [\"0\"],\r\n\t\t\tcount = startNumbers.length;\r\n\t\tlet index = 0;\r\n\r\n\t\tsequence = findPattern([endValue.replace(/\\d+\\.?\\d*/g, () => {\r\n\t\t\treturn startNumbers[index++ % count];\r\n\t\t}), endValue], propertyName);\r\n\t}\r\n\tif (sequence) {\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`Velocity: Sequence found:`, sequence);\r\n\t\t}\r\n\t\tsequence[0].percent = 0;\r\n\t\tsequence[1].percent = 1;\r\n\t\ttween.sequence = sequence;\r\n\t\tswitch (tween.easing) {\r\n\t\t\tcase Easings[\"at-start\"]:\r\n\t\t\tcase Easings[\"during\"]:\r\n\t\t\tcase Easings[\"at-end\"]:\r\n\t\t\t\tsequence[0].easing = sequence[1].easing = tween.easing;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Expand all queued animations that haven't gone yet\r\n *\r\n * This will automatically expand the properties map for any recently added\r\n * animations so that the start and end values are correct.\r\n */\r\nexport function validateTweens(activeCall: AnimationCall) {\r\n\t// This might be called on an already-ready animation\r\n\tif (State.firstNew === activeCall) {\r\n\t\tState.firstNew = activeCall._next;\r\n\t}\r\n\t// Check if we're actually already ready\r\n\tif (activeCall._flags & AnimationFlags.EXPANDED) { // tslint:disable-line:no-bitwise\r\n\t\treturn;\r\n\t}\r\n\tconst element = activeCall.element,\r\n\t\ttweens = activeCall.tweens,\r\n\t\tduration = getValue(activeCall.options.duration, defaults.duration);\r\n\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const propertyName in tweens) {\r\n\t\tconst tween = tweens[propertyName];\r\n\r\n\t\tif (tween.start == null) {\r\n\t\t\t// Get the start value as it's not been passed in\r\n\t\t\tconst startValue = getPropertyValue(activeCall.element, propertyName);\r\n\r\n\t\t\tif (isString(startValue)) {\r\n\t\t\t\ttween.start = fixColors(startValue) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration, true);\r\n\t\t\t} else if (!Array.isArray(startValue)) {\r\n\t\t\t\tconsole.warn(`bad type`, tween, propertyName, startValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`tweensContainer \"${propertyName}\": ${JSON.stringify(tween)}`, element);\r\n\t\t}\r\n\t}\r\n\tactiveCall._flags |= AnimationFlags.EXPANDED; // tslint:disable-line:no-bitwise\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tick\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, TweenStep, VelocityCallback, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {now} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {completeCall} from \"./complete\";\r\nimport {setPropertyValue} from \"./css/setPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {linearEasing} from \"./easing/easings\";\r\nimport {freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\nimport {validateTweens} from \"./tweens\";\r\n\r\n/**\r\n * Call the begin method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nexport function callBegin(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.begin as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Call the progress method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callProgress(activeCall: AnimationCall, timeCurrent: number) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements,\r\n\t\t\tpercentComplete = activeCall.percentComplete,\r\n\t\t\toptions = activeCall.options,\r\n\t\t\ttweenValue = activeCall.tween;\r\n\r\n\t\t(activeCall.options.progress as VelocityProgress).call(elements,\r\n\t\t\telements,\r\n\t\t\tpercentComplete,\r\n\t\t\tMath.max(0, activeCall.timeStart + (activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaults.duration) - timeCurrent),\r\n\t\t\ttweenValue !== undefined ? tweenValue : String(percentComplete * 100),\r\n\t\t\tactiveCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\nfunction asyncCallbacks() {\r\n\tlet activeCall: AnimationCall,\r\n\t\tnextCall: AnimationCall;\r\n\t// Callbacks and complete that might read the DOM again.\r\n\r\n\t// Progress callback\r\n\tfor (activeCall = firstProgress; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextProgress;\r\n\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\tcallProgress(activeCall, lastTick);\r\n\t}\r\n\t// Complete animations, including complete callback or looping\r\n\tfor (activeCall = firstComplete; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextComplete;\r\n\t\t/* If this call has finished tweening, pass it to complete() to handle call cleanup. */\r\n\t\tcompleteCall(activeCall);\r\n\t}\r\n}\r\n\r\n/**************\r\n Timing\r\n **************/\r\n\r\nconst FRAME_TIME = 1000 / 60,\r\n\t/**\r\n\t * Shim for window.performance in case it doesn't exist\r\n\t */\r\n\tperformance = (() => {\r\n\t\tconst perf = window.performance || {} as Performance;\r\n\r\n\t\tif (typeof perf.now !== \"function\") {\r\n\t\t\tconst nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : now();\r\n\r\n\t\t\tperf.now = () => {\r\n\t\t\t\treturn now() - nowOffset;\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn perf;\r\n\t})(),\r\n\t/**\r\n\t * Proxy function for when rAF is not available.\r\n\t *\r\n\t * This should hopefully never be used as the browsers often throttle\r\n\t * this to less than one frame per second in the background, making it\r\n\t * completely unusable.\r\n\t */\r\n\trAFProxy = (callback: FrameRequestCallback) => {\r\n\t\treturn setTimeout(callback, Math.max(0, FRAME_TIME - (performance.now() - lastTick)));\r\n\t},\r\n\t/**\r\n\t * Either requestAnimationFrame, or a shim for it.\r\n\t */\r\n\trAFShim = window.requestAnimationFrame || rAFProxy;\r\n\r\n/**\r\n * Set if we are currently inside a tick() to prevent double-calling.\r\n */\r\nlet ticking: boolean,\r\n\t/**\r\n\t * A background WebWorker that sends us framerate messages when we're in\r\n\t * the background. Without this we cannot maintain frame accuracy.\r\n\t */\r\n\tworker: Worker,\r\n\t/**\r\n\t * The first animation with a Progress callback.\r\n\t */\r\n\tfirstProgress: AnimationCall,\r\n\t/**\r\n\t * The first animation with a Complete callback.\r\n\t */\r\n\tfirstComplete: AnimationCall;\r\n\r\n/**\r\n * The time that the last animation frame ran at. Set from tick(), and used\r\n * for missing rAF (ie, when not in focus etc).\r\n */\r\nexport let lastTick: number = 0;\r\n\r\n/**\r\n * WebWorker background function.\r\n *\r\n * When we're in the background this will send us a msg every tick, when in\r\n * the foreground it won't.\r\n *\r\n * When running in the background the browser reduces allowed CPU etc, so\r\n * we raun at 30fps instead of 60fps.\r\n */\r\nfunction workerFn(this: Worker) {\r\n\tlet interval: any;\r\n\r\n\tthis.onmessage = (e) => {\r\n\t\tswitch (e.data) {\r\n\t\t\tcase true:\r\n\t\t\t\tif (!interval) {\r\n\t\t\t\t\tinterval = setInterval(() => {\r\n\t\t\t\t\t\tthis.postMessage(true);\r\n\t\t\t\t\t}, 1000 / 30);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase false:\r\n\t\t\t\tif (interval) {\r\n\t\t\t\t\tclearInterval(interval);\r\n\t\t\t\t\tinterval = 0;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthis.postMessage(e.data);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n}\r\n\r\ntry {\r\n\t// Create the worker - this might not be supported, hence the try/catch.\r\n\tworker = new Worker(URL.createObjectURL(new Blob([`(${workerFn})()`])));\r\n\t// Whenever the worker sends a message we tick()\r\n\tworker.onmessage = (e: MessageEvent) => {\r\n\t\tif (e.data === true) {\r\n\t\t\ttick();\r\n\t\t} else {\r\n\t\t\tasyncCallbacks();\r\n\t\t}\r\n\t};\r\n\t// And watch for going to the background to start the WebWorker running.\r\n\tif (!State.isMobile && document.hidden !== undefined) {\r\n\t\tdocument.addEventListener(\"visibilitychange\", () => {\r\n\t\t\tworker.postMessage(State.isTicking && document.hidden);\r\n\t\t});\r\n\t}\r\n} catch (e) {\r\n\t/*\r\n\t * WebWorkers are not supported in this format. This can happen in IE10\r\n\t * where it can't create one from a blob this way. We fallback, but make\r\n\t * no guarantees towards accuracy in this case.\r\n\t */\r\n}\r\n\r\n/**\r\n * Called on every tick, preferably through rAF. This is reponsible for\r\n * initialising any new animations, then starting any that need starting.\r\n * Finally it will expand any tweens and set the properties relating to\r\n * them. If there are any callbacks relating to the animations then they\r\n * will attempt to call at the end (with the exception of \"begin\").\r\n */\r\nexport function tick(timestamp?: number | boolean) {\r\n\tif (ticking) {\r\n\t\t// Should never happen - but if we've swapped back from hidden to\r\n\t\t// visibile then we want to make sure\r\n\t\treturn;\r\n\t}\r\n\tticking = true;\r\n\t/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\r\n\t We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\r\n\t the browser's next tick sync time occurs, which results in the first elements subjected to Velocity\r\n\t calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore\r\n\t the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated\r\n\t by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */\r\n\tif (timestamp !== false) {\r\n\t\tconst timeCurrent = performance.now(),\r\n\t\t\tdeltaTime = lastTick ? timeCurrent - lastTick : FRAME_TIME,\r\n\t\t\tdefaultSpeed = defaults.speed,\r\n\t\t\tdefaultEasing = defaults.easing,\r\n\t\t\tdefaultDuration = defaults.duration;\r\n\t\tlet activeCall: AnimationCall,\r\n\t\t\tnextCall: AnimationCall,\r\n\t\t\tlastProgress: AnimationCall,\r\n\t\t\tlastComplete: AnimationCall;\r\n\r\n\t\tfirstProgress = null;\r\n\t\tfirstComplete = null;\r\n\t\tif (deltaTime >= defaults.minFrameTime || !lastTick) {\r\n\t\t\tlastTick = timeCurrent;\r\n\r\n\t\t\t/********************\r\n\t\t\t Call Iteration\r\n\t\t\t ********************/\r\n\r\n\t\t\t// Expand any tweens that might need it.\r\n\t\t\twhile (State.firstNew) {\r\n\t\t\t\tvalidateTweens(State.firstNew);\r\n\t\t\t}\r\n\t\t\t// Iterate through each active call.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = activeCall._next) {\r\n\t\t\t\tconst element = activeCall.element,\r\n\t\t\t\t\tdata = Data(element);\r\n\r\n\t\t\t\t// Check to see if this element has been deleted midway\r\n\t\t\t\t// through the animation. If it's gone then end this\r\n\t\t\t\t// animation.\r\n\t\t\t\tif (!element.parentNode || !data) {\r\n\t\t\t\t\t// TODO: Remove safely - decrease count, delete data, remove from arrays\r\n\t\t\t\t\tfreeAnimationCall(activeCall);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tconst options = activeCall.options,\r\n\t\t\t\t\tflags = activeCall._flags;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// If this is the first time that this call has been\r\n\t\t\t\t// processed by tick() then we assign timeStart now so that\r\n\t\t\t\t// it's value is as close to the real animation start time\r\n\t\t\t\t// as possible.\r\n\t\t\t\tif (!timeStart) {\r\n\t\t\t\t\tconst queue = activeCall.queue != null ? activeCall.queue : options.queue;\r\n\r\n\t\t\t\t\ttimeStart = timeCurrent - deltaTime;\r\n\t\t\t\t\tif (queue !== false) {\r\n\t\t\t\t\t\ttimeStart = Math.max(timeStart, data.lastFinishList[queue] || 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall.timeStart = timeStart;\r\n\t\t\t\t}\r\n\t\t\t\t// If this animation is paused then skip processing unless\r\n\t\t\t\t// it has been set to resume.\r\n\t\t\t\tif (flags & AnimationFlags.PAUSED) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// Update the time start to accomodate the paused\r\n\t\t\t\t\t// completion amount.\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Check if this animation is ready - if it's synced then it\r\n\t\t\t\t// needs to wait for all other animations in the sync\r\n\t\t\t\tif (!(flags & AnimationFlags.READY)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.READY; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\toptions._ready++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Need to split the loop, as ready sync animations must all get\r\n\t\t\t// the same start time.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = nextCall) {\r\n\t\t\t\tconst flags = activeCall._flags;\r\n\r\n\t\t\t\tnextCall = activeCall._next;\r\n\t\t\t\tif (!(flags & AnimationFlags.READY) || (flags & AnimationFlags.PAUSED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst options = activeCall.options;\r\n\r\n\t\t\t\tif ((flags & AnimationFlags.SYNC) && options._ready < options._total) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst speed = activeCall.speed != null ? activeCall.speed : options.speed != null ? options.speed : defaultSpeed;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tif (!(flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tconst delay = activeCall.delay != null ? activeCall.delay : options.delay;\r\n\r\n\t\t\t\t\t// Make sure anything we've delayed doesn't start\r\n\t\t\t\t\t// animating yet, there might still be an active delay\r\n\t\t\t\t\t// after something has been un-paused\r\n\t\t\t\t\tif (delay) {\r\n\t\t\t\t\t\tif (timeStart + (delay / speed) > timeCurrent) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactiveCall.timeStart = timeStart += delay / (delay > 0 ? speed : 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// The begin callback is fired once per call, not once\r\n\t\t\t\t\t// per element, and is passed the full raw DOM element\r\n\t\t\t\t\t// set as both its context and its first argument.\r\n\t\t\t\t\tif (options._started++ === 0) {\r\n\t\t\t\t\t\toptions._first = activeCall;\r\n\t\t\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\t\t\tcallBegin(activeCall);\r\n\t\t\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (speed !== 1) {\r\n\t\t\t\t\t// On the first frame we may have a shorter delta\r\n\t\t\t\t\tconst delta = Math.min(deltaTime, timeCurrent - timeStart);\r\n\t\t\t\t\tactiveCall.timeStart = timeStart += delta * (1 - speed);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options._first === activeCall && options.progress) {\r\n\t\t\t\t\tactiveCall._nextProgress = undefined;\r\n\t\t\t\t\tif (lastProgress) {\r\n\t\t\t\t\t\tlastProgress._nextProgress = lastProgress = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstProgress = lastProgress = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst activeEasing = activeCall.easing != null ? activeCall.easing : options.easing != null ? options.easing : defaultEasing,\r\n\t\t\t\t\tmillisecondsEllapsed = activeCall.ellapsedTime = timeCurrent - timeStart,\r\n\t\t\t\t\tduration = activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaultDuration,\r\n\t\t\t\t\tpercentComplete = activeCall.percentComplete = Velocity.mock ? 1 : Math.min(millisecondsEllapsed / duration, 1),\r\n\t\t\t\t\ttweens = activeCall.tweens,\r\n\t\t\t\t\treverse = flags & AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\r\n\t\t\t\tif (percentComplete === 1) {\r\n\t\t\t\t\tactiveCall._nextComplete = undefined;\r\n\t\t\t\t\tif (lastComplete) {\r\n\t\t\t\t\t\tlastComplete._nextComplete = lastComplete = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstComplete = lastComplete = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const property in tweens) {\r\n\t\t\t\t\t// For every element, iterate through each property.\r\n\t\t\t\t\tconst tween = tweens[property],\r\n\t\t\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\t\t\tpattern = sequence.pattern;\r\n\t\t\t\t\tlet currentValue = \"\",\r\n\t\t\t\t\t\ti = 0;\r\n\r\n\t\t\t\t\tif (pattern) {\r\n\t\t\t\t\t\tconst easingComplete = (tween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\t\t\t\tlet best = 0;\r\n\r\n\t\t\t\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\t\t\t\tbest = j;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\t\t\t\teasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\t\t\t\tconst result = easing(reverse ? 1 - tweenPercent : tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(result) : result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (property !== \"tween\") {\r\n\t\t\t\t\t\t\tif (percentComplete === 1 && currentValue.startsWith(\"calc(0 + \")) {\r\n\t\t\t\t\t\t\t\tcurrentValue = currentValue.replace(/^calc\\(0[^\\d]* \\+ ([^\\(\\)]+)\\)$/, \"$1\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// TODO: To solve an IE<=8 positioning bug, the unit type must be dropped when setting a property value of 0 - add normalisations to legacy\r\n\t\t\t\t\t\t\tsetPropertyValue(activeCall.element, property, currentValue, tween.fn);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Skip the fake 'tween' property as that is only\r\n\t\t\t\t\t\t\t// passed into the progress callback.\r\n\t\t\t\t\t\t\tactiveCall.tween = currentValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Missing pattern:`, property, JSON.stringify(tween[property]));\r\n\t\t\t\t\t\tdelete tweens[property];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (firstProgress || firstComplete) {\r\n\t\t\t\tif (document.hidden) {\r\n\t\t\t\t\tasyncCallbacks();\r\n\t\t\t\t} else if (worker) {\r\n\t\t\t\t\tworker.postMessage(\"\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(asyncCallbacks, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (State.first) {\r\n\t\tState.isTicking = true;\r\n\t\tif (!document.hidden) {\r\n\t\t\trAFShim(tick);\r\n\t\t} else if (!worker) {\r\n\t\t\trAFProxy(tick);\r\n\t\t} else if (timestamp === false) {\r\n\t\t\t// Make sure we turn on the messages.\r\n\t\t\tworker.postMessage(true);\r\n\t\t}\r\n\t} else {\r\n\t\tState.isTicking = false;\r\n\t\tlastTick = 0;\r\n\t\tif (document.hidden && worker) {\r\n\t\t\t// Make sure we turn off the messages.\r\n\t\t\tworker.postMessage(false);\r\n\t\t}\r\n\t}\r\n\tticking = false;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Finish all animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {callBegin} from \"../tick\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be finished, and if so we set the tweens to\r\n * the final value for it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeFinished(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (!(animation._flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t// Copied from tick.ts - ensure that the animation is completely\r\n\t\t\t// valid and run begin() before complete().\r\n\t\t\tconst options = animation.options;\r\n\r\n\t\t\t// The begin callback is fired once per call, not once per\r\n\t\t\t// element, and is passed the full raw DOM element set as both\r\n\t\t\t// its context and its first argument.\r\n\t\t\tif (options._started++ === 0) {\r\n\t\t\t\toptions._first = animation;\r\n\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\tcallBegin(animation);\r\n\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tanimation._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\t// tslint:disable-next-line:forin\r\n\t\tfor (const property in animation.tweens) {\r\n\t\t\tconst tween = animation.tweens[property],\r\n\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\tpattern = sequence.pattern;\r\n\t\t\tlet currentValue = \"\",\r\n\t\t\t\ti = 0;\r\n\r\n\t\t\tif (pattern) {\r\n\t\t\t\tconst endValues = sequence[sequence.length - 1];\r\n\r\n\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\tconst endValue = endValues[i];\r\n\r\n\t\t\t\t\tcurrentValue += endValue == null ? pattern[i] : endValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetPropertyValue(animation.element, property, currentValue, tween.fn);\r\n\t\t}\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the finish action is triggered, the elements' currently active call is\r\n * immediately finished. When an element is finished, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are finished. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n */\r\nfunction finish(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeFinished(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeFinished(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"finish\", finish], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a value from one or more running animations.\r\n */\r\n\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateFpsLimit, validateLoop, validateQueue, validateRepeat,\r\n} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {lastTick} from \"../tick\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Used to map getters for the various AnimationFlags.\r\n */\r\nconst animationFlags: {[key: string]: number} = {\r\n\tisExpanded: AnimationFlags.EXPANDED,\r\n\tisReady: AnimationFlags.READY,\r\n\tisStarted: AnimationFlags.STARTED,\r\n\tisStopped: AnimationFlags.STOPPED,\r\n\tisPaused: AnimationFlags.PAUSED,\r\n\tisSync: AnimationFlags.SYNC,\r\n\tisReverse: AnimationFlags.REVERSE,\r\n};\r\n\r\n/**\r\n * Get or set an option or running AnimationCall data value. If there is no\r\n * value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n */\r\nfunction option(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst key = args[0],\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(queue, true);\r\n\tlet animations: AnimationCall[],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!key) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant key!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// If we're chaining the return value from Velocity then we are only\r\n\t// interested in the values related to that call\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tanimations = elements.velocity.animations;\r\n\t} else {\r\n\t\tanimations = [];\r\n\r\n\t\tfor (let activeCall = State.first; activeCall; activeCall = activeCall._next) {\r\n\t\t\tif (elements.indexOf(activeCall.element) >= 0 && getValue(activeCall.queue, activeCall.options.queue) === queueName) {\r\n\t\t\t\tanimations.push(activeCall);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we're dealing with multiple elements that are pointing at a\r\n\t\t// single running animation, then instead treat them as a single\r\n\t\t// animation.\r\n\t\tif (elements.length > 1 && animations.length > 1) {\r\n\t\t\tlet i = 1,\r\n\t\t\t\toptions = animations[0].options;\r\n\r\n\t\t\twhile (i < animations.length) {\r\n\t\t\t\tif (animations[i++].options !== options) {\r\n\t\t\t\t\toptions = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: this needs to check that they're actually a sync:true animation to merge the results, otherwise the individual values may be different\r\n\t\t\tif (options) {\r\n\t\t\t\tanimations = [animations[0]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// GET\r\n\tif (value === undefined) {\r\n\t\tconst result = [],\r\n\t\t\tflag = animationFlags[key];\r\n\r\n\t\tfor (const animation of animations) {\r\n\t\t\tif (flag === undefined) {\r\n\t\t\t\t// A normal key to get.\r\n\t\t\t\tresult.push(getValue(animation[key], animation.options[key]));\r\n\t\t\t} else {\r\n\t\t\t\t// A flag that we're checking against.\r\n\t\t\t\tresult.push((animation._flags & flag) === 0); // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (elements.length === 1 && animations.length === 1) {\r\n\t\t\t// If only a single animation is found and we're only targetting a\r\n\t\t\t// single element, then return the value directly\r\n\t\t\treturn result[0];\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tlet isPercentComplete: boolean;\r\n\r\n\tswitch (key) {\r\n\t\tcase \"cache\":\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tbreak;\r\n\t\tcase \"begin\":\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tbreak;\r\n\t\tcase \"complete\":\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tbreak;\r\n\t\tcase \"delay\":\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tbreak;\r\n\t\tcase \"duration\":\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tbreak;\r\n\t\tcase \"fpsLimit\":\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tbreak;\r\n\t\tcase \"loop\":\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tbreak;\r\n\t\tcase \"percentComplete\":\r\n\t\t\tisPercentComplete = true;\r\n\t\t\tvalue = parseFloat(value);\r\n\t\t\tbreak;\r\n\t\tcase \"repeat\":\r\n\t\tcase \"repeatAgain\":\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tif (key[0] !== \"_\") {\r\n\t\t\t\tconst num = parseFloat(value);\r\n\r\n\t\t\t\tif (value === String(num)) {\r\n\t\t\t\t\tvalue = num;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t// deliberate fallthrough\r\n\t\tcase \"queue\":\r\n\t\tcase \"promise\":\r\n\t\tcase \"promiseRejectEmpty\":\r\n\t\tcase \"easing\":\r\n\t\tcase \"started\":\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set a read-only key:`, key);\r\n\r\n\t\t\treturn;\r\n\t}\r\n\tif (value === undefined || value !== value) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set an invalid value:${key}=${value} (${args[1]})`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\tfor (const animation of animations) {\r\n\t\tif (isPercentComplete) {\r\n\t\t\tanimation.timeStart = lastTick - (getValue(animation.duration, animation.options.duration, defaults.duration) * value);\r\n\t\t} else {\r\n\t\t\tanimation[key] = value;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"option\", option], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Pause and resume animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be paused / resumed.\r\n */\r\nfunction checkAnimation(animation: AnimationCall, queueName: false | string, defaultQueue: false | string, isPaused: boolean) {\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (isPaused) {\r\n\t\t\tanimation._flags |= AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t} else {\r\n\t\t\tanimation._flags &= ~AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Pause and Resume are call-wide (not on a per element basis). Thus, calling pause or resume on a\r\n * single element will cause any calls that contain tweens for that element to be paused/resumed\r\n * as well.\r\n */\r\nfunction pauseResume(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string) {\r\n\tconst isPaused = action.indexOf(\"pause\") === 0,\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(args[0]),\r\n\t\tdefaultQueue = defaults.queue;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimation(animation, queueName, defaultQueue, isPaused);\r\n\t\t}\r\n\t} else {\r\n\t\tlet activeCall: AnimationCall = State.first;\r\n\r\n\t\twhile (activeCall) {\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimation(activeCall, queueName, defaultQueue, isPaused);\r\n\t\t\t}\r\n\t\t\tactiveCall = activeCall._next;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"pause\", pauseResume], true);\r\nregisterAction([\"resume\", pauseResume], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerAction} from \"./actions\";\r\n\r\nregisterAction([\"reverse\", (args?: any[], elements?: HTMLorSVGElement[] | VelocityResult, promiseHandler?: VelocityPromise, action?: string) => {\r\n\t// NOTE: Code needs to split out before here - but this is needed to prevent it being overridden\r\n\tthrow new SyntaxError(\"VelocityJS: The 'reverse' action is built in and private.\");\r\n}], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Stop animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be stopped, and if so then set the STOPPED\r\n * flag on it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeStopped(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tanimation._flags |= AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the stop action is triggered, the elements' currently active call is\r\n * immediately stopped. When an element is stopped, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are stopped. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n *\r\n * Note: The stop command runs prior to Velocity's Queueing phase since its\r\n * behavior is intended to take effect *immediately*, regardless of the\r\n * element's current queue state.\r\n */\r\nfunction stop(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise, action?: string): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeStopped(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeStopped(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"stop\", stop], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString, isVelocityResult} from \"../../types\";\r\nimport {fixColors} from \"../css/fixColors\";\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function style(elements: VelocityResult, property: {[property: string]: string}): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string): string | string[];\r\nexport function style(elements: VelocityResult, property: string, value: string): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string | {[property: string]: string}, value?: string) {\r\n\treturn styleAction([property, value], elements);\r\n}\r\n\r\n/**\r\n * Get or set a style of Nomralised property value on one or more elements.\r\n * If there is no value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n *\r\n * This can fail to set, and will reject the Promise if it does so.\r\n *\r\n * Velocity(elements, \"style\", \"property\", \"value\") => elements;\r\n * Velocity(elements, \"style\", {\"property\": \"value\", ...}) => elements;\r\n * Velocity(element, \"style\", \"property\") => \"value\";\r\n * Velocity(elements, \"style\", \"property\") => [\"value\", ...];\r\n */\r\nfunction styleAction(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst property = args[0],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!property) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant property!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// GET\r\n\tif (value === undefined && !isPlainObject(property)) {\r\n\t\t// If only a single animation is found and we're only targetting a\r\n\t\t// single element, then return the value directly\r\n\t\tif (elements.length === 1) {\r\n\t\t\treturn fixColors(getPropertyValue(elements[0], property));\r\n\t\t}\r\n\t\tconst result = [];\r\n\r\n\t\tfor (const element of elements) {\r\n\t\t\tresult.push(fixColors(getPropertyValue(element, property)));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tconst error: string[] = [];\r\n\r\n\tif (isPlainObject(property)) {\r\n\t\tfor (const propertyName in property) {\r\n\t\t\tif (property.hasOwnProperty(propertyName)) {\r\n\t\t\t\tfor (const element of elements) {\r\n\t\t\t\t\tconst propertyValue = property[propertyName];\r\n\r\n\t\t\t\t\tif (isString(propertyValue) || isNumber(propertyValue)) {\r\n\t\t\t\t\t\tsetPropertyValue(element, propertyName, property[propertyName]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\terror.push(`Cannot set a property \"${propertyName}\" to an unknown type: ${typeof propertyValue}`);\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Cannot set a property \"${propertyName}\" to an unknown type:`, propertyValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(value) || isNumber(value)) {\r\n\t\tfor (const element of elements) {\r\n\t\t\tsetPropertyValue(element, property, String(value));\r\n\t\t}\r\n\t} else {\r\n\t\terror.push(`Cannot set a property \"${property}\" to an unknown type: ${typeof value}`);\r\n\t\tconsole.warn(`VelocityJS: Cannot set a property \"${property}\" to an unknown type:`, value);\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (error.length) {\r\n\t\t\tpromiseHandler._rejecter(error.join(\", \"));\r\n\t\t} else if (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"style\", styleAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, HTMLorSVGElement, Properties, Sequence, SequenceList,\r\n\tTweenStep, VelocityEasingType, VelocityPromise, VelocityProperty,\r\n} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {linearEasing} from \"../easing/easings\";\r\nimport {validateEasing} from \"../options\";\r\nimport {expandSequence} from \"../sequences\";\r\nimport {SequencesObject} from \"../sequencesObject\";\r\nimport {expandProperties} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../../constants\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, properties: Properties, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, propertyName: string, property: VelocityProperty, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], ...args: any[]) {\r\n\treturn tweenAction(arguments as any, elements);\r\n}\r\n\r\n/**\r\n *\r\n */\r\nfunction tweenAction(args?: any[], elements?: HTMLorSVGElement[], promiseHandler?: VelocityPromise, action?: string): any {\r\n\tlet requireForcefeeding: boolean;\r\n\r\n\tif (!elements) {\r\n\t\tif (!args.length) {\r\n\t\t\tconsole.info(`Velocity(, \\\"tween\\\", percentComplete, property, end | [end, , ], ) => value\r\nVelocity(, \\\"tween\\\", percentComplete, {property: end | [end, , ], ...}, ) => {property: value, ...}`);\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\telements = [document.body];\r\n\t\trequireForcefeeding = true;\r\n\t} else if (elements.length !== 1) {\r\n\t\t// TODO: Allow more than a single element to return an array of results\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween more than one element!\");\r\n\t}\r\n\tconst percentComplete: number = args[0],\r\n\t\tfakeAnimation = {\r\n\t\t\telements,\r\n\t\t\telement: elements[0],\r\n\t\t\tqueue: false,\r\n\t\t\toptions: {\r\n\t\t\t\tduration: 1000,\r\n\t\t\t},\r\n\t\t\ttweens: null as {[property: string]: Sequence},\r\n\t\t} as any as AnimationCall,\r\n\t\tresult: {[property: string]: string} = {};\r\n\tlet properties: Properties = args[1],\r\n\t\tsingleResult: boolean,\r\n\t\tmaybeSequence: SequenceList,\r\n\t\teasing: VelocityEasingType = args[2],\r\n\t\tcount = 0;\r\n\r\n\tif (isString(args[1])) {\r\n\t\tif (SequencesObject && SequencesObject[args[1]]) {\r\n\t\t\tmaybeSequence = SequencesObject[args[1]];\r\n\t\t\tproperties = {};\r\n\t\t\teasing = args[2];\r\n\t\t} else {\r\n\t\t\tsingleResult = true;\r\n\t\t\tproperties = {\r\n\t\t\t\t[args[1]]: args[2],\r\n\t\t\t};\r\n\t\t\teasing = args[3];\r\n\t\t}\r\n\t} else if (Array.isArray(args[1])) {\r\n\t\tsingleResult = true;\r\n\t\tproperties = {\r\n\t\t\ttween: args[1],\r\n\t\t} as any;\r\n\t\teasing = args[2];\r\n\t}\r\n\tif (!isNumber(percentComplete) || percentComplete < 0 || percentComplete > 1) {\r\n\t\tthrow new Error(\"VelocityJS: Must tween a percentage from 0 to 1!\");\r\n\t}\r\n\tif (!isPlainObject(properties)) {\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween an invalid property!\");\r\n\t}\r\n\tif (requireForcefeeding) {\r\n\t\tfor (const property in properties) {\r\n\t\t\tif (properties.hasOwnProperty(property) && (!Array.isArray(properties[property]) || properties[property].length < 2)) {\r\n\t\t\t\tthrow new Error(\"VelocityJS: When not supplying an element you must force-feed values: \" + property);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst activeEasing = validateEasing(getValue(easing, defaults.easing), DEFAULT_DURATION);\r\n\r\n\tif (maybeSequence) {\r\n\t\texpandSequence(fakeAnimation, maybeSequence);\r\n\t} else {\r\n\t\texpandProperties(fakeAnimation as AnimationCall, properties);\r\n\t}\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const property in fakeAnimation.tweens) {\r\n\t\t// For every element, iterate through each property.\r\n\t\tconst propertyTween = fakeAnimation.tweens[property],\r\n\t\t\tsequence = propertyTween.sequence,\r\n\t\t\tpattern = sequence.pattern;\r\n\t\tlet currentValue = \"\",\r\n\t\t\ti = 0;\r\n\r\n\t\tcount++;\r\n\t\tif (pattern) {\r\n\t\t\tconst easingComplete = (propertyTween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\tlet best = 0;\r\n\r\n\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\tbest = j;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\ttweenEasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\tconst value = tweenEasing(tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(value) : value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresult[property] = currentValue;\r\n\t\t}\r\n\t}\r\n\r\n\tif (singleResult && count === 1) {\r\n\t\tfor (const property in result) {\r\n\t\t\tif (result.hasOwnProperty(property)) {\r\n\t\t\t\treturn result[property];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nregisterAction([\"tween\", tweenAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {ColorNames} from \"./fixColors\";\r\n\r\n/**\r\n * Converting from hex as it makes for a smaller file.\r\n */\r\nconst colorValues = {\r\n\taliceblue: 0xF0F8FF,\r\n\tantiquewhite: 0xFAEBD7,\r\n\taqua: 0x00FFFF,\r\n\taquamarine: 0x7FFFD4,\r\n\tazure: 0xF0FFFF,\r\n\tbeige: 0xF5F5DC,\r\n\tbisque: 0xFFE4C4,\r\n\tblack: 0x000000,\r\n\tblanchedalmond: 0xFFEBCD,\r\n\tblue: 0x0000FF,\r\n\tblueviolet: 0x8A2BE2,\r\n\tbrown: 0xA52A2A,\r\n\tburlywood: 0xDEB887,\r\n\tcadetblue: 0x5F9EA0,\r\n\tchartreuse: 0x7FFF00,\r\n\tchocolate: 0xD2691E,\r\n\tcoral: 0xFF7F50,\r\n\tcornflowerblue: 0x6495ED,\r\n\tcornsilk: 0xFFF8DC,\r\n\tcrimson: 0xDC143C,\r\n\tcyan: 0x00FFFF,\r\n\tdarkblue: 0x00008B,\r\n\tdarkcyan: 0x008B8B,\r\n\tdarkgoldenrod: 0xB8860B,\r\n\tdarkgray: 0xA9A9A9,\r\n\tdarkgrey: 0xA9A9A9,\r\n\tdarkgreen: 0x006400,\r\n\tdarkkhaki: 0xBDB76B,\r\n\tdarkmagenta: 0x8B008B,\r\n\tdarkolivegreen: 0x556B2F,\r\n\tdarkorange: 0xFF8C00,\r\n\tdarkorchid: 0x9932CC,\r\n\tdarkred: 0x8B0000,\r\n\tdarksalmon: 0xE9967A,\r\n\tdarkseagreen: 0x8FBC8F,\r\n\tdarkslateblue: 0x483D8B,\r\n\tdarkslategray: 0x2F4F4F,\r\n\tdarkslategrey: 0x2F4F4F,\r\n\tdarkturquoise: 0x00CED1,\r\n\tdarkviolet: 0x9400D3,\r\n\tdeeppink: 0xFF1493,\r\n\tdeepskyblue: 0x00BFFF,\r\n\tdimgray: 0x696969,\r\n\tdimgrey: 0x696969,\r\n\tdodgerblue: 0x1E90FF,\r\n\tfirebrick: 0xB22222,\r\n\tfloralwhite: 0xFFFAF0,\r\n\tforestgreen: 0x228B22,\r\n\tfuchsia: 0xFF00FF,\r\n\tgainsboro: 0xDCDCDC,\r\n\tghostwhite: 0xF8F8FF,\r\n\tgold: 0xFFD700,\r\n\tgoldenrod: 0xDAA520,\r\n\tgray: 0x808080,\r\n\tgrey: 0x808080,\r\n\tgreen: 0x008000,\r\n\tgreenyellow: 0xADFF2F,\r\n\thoneydew: 0xF0FFF0,\r\n\thotpink: 0xFF69B4,\r\n\tindianred: 0xCD5C5C,\r\n\tindigo: 0x4B0082,\r\n\tivory: 0xFFFFF0,\r\n\tkhaki: 0xF0E68C,\r\n\tlavender: 0xE6E6FA,\r\n\tlavenderblush: 0xFFF0F5,\r\n\tlawngreen: 0x7CFC00,\r\n\tlemonchiffon: 0xFFFACD,\r\n\tlightblue: 0xADD8E6,\r\n\tlightcoral: 0xF08080,\r\n\tlightcyan: 0xE0FFFF,\r\n\tlightgoldenrodyellow: 0xFAFAD2,\r\n\tlightgray: 0xD3D3D3,\r\n\tlightgrey: 0xD3D3D3,\r\n\tlightgreen: 0x90EE90,\r\n\tlightpink: 0xFFB6C1,\r\n\tlightsalmon: 0xFFA07A,\r\n\tlightseagreen: 0x20B2AA,\r\n\tlightskyblue: 0x87CEFA,\r\n\tlightslategray: 0x778899,\r\n\tlightslategrey: 0x778899,\r\n\tlightsteelblue: 0xB0C4DE,\r\n\tlightyellow: 0xFFFFE0,\r\n\tlime: 0x00FF00,\r\n\tlimegreen: 0x32CD32,\r\n\tlinen: 0xFAF0E6,\r\n\tmagenta: 0xFF00FF,\r\n\tmaroon: 0x800000,\r\n\tmediumaquamarine: 0x66CDAA,\r\n\tmediumblue: 0x0000CD,\r\n\tmediumorchid: 0xBA55D3,\r\n\tmediumpurple: 0x9370DB,\r\n\tmediumseagreen: 0x3CB371,\r\n\tmediumslateblue: 0x7B68EE,\r\n\tmediumspringgreen: 0x00FA9A,\r\n\tmediumturquoise: 0x48D1CC,\r\n\tmediumvioletred: 0xC71585,\r\n\tmidnightblue: 0x191970,\r\n\tmintcream: 0xF5FFFA,\r\n\tmistyrose: 0xFFE4E1,\r\n\tmoccasin: 0xFFE4B5,\r\n\tnavajowhite: 0xFFDEAD,\r\n\tnavy: 0x000080,\r\n\toldlace: 0xFDF5E6,\r\n\tolive: 0x808000,\r\n\tolivedrab: 0x6B8E23,\r\n\torange: 0xFFA500,\r\n\torangered: 0xFF4500,\r\n\torchid: 0xDA70D6,\r\n\tpalegoldenrod: 0xEEE8AA,\r\n\tpalegreen: 0x98FB98,\r\n\tpaleturquoise: 0xAFEEEE,\r\n\tpalevioletred: 0xDB7093,\r\n\tpapayawhip: 0xFFEFD5,\r\n\tpeachpuff: 0xFFDAB9,\r\n\tperu: 0xCD853F,\r\n\tpink: 0xFFC0CB,\r\n\tplum: 0xDDA0DD,\r\n\tpowderblue: 0xB0E0E6,\r\n\tpurple: 0x800080,\r\n\trebeccapurple: 0x663399,\r\n\tred: 0xFF0000,\r\n\trosybrown: 0xBC8F8F,\r\n\troyalblue: 0x4169E1,\r\n\tsaddlebrown: 0x8B4513,\r\n\tsalmon: 0xFA8072,\r\n\tsandybrown: 0xF4A460,\r\n\tseagreen: 0x2E8B57,\r\n\tseashell: 0xFFF5EE,\r\n\tsienna: 0xA0522D,\r\n\tsilver: 0xC0C0C0,\r\n\tskyblue: 0x87CEEB,\r\n\tslateblue: 0x6A5ACD,\r\n\tslategray: 0x708090,\r\n\tslategrey: 0x708090,\r\n\tsnow: 0xFFFAFA,\r\n\tspringgreen: 0x00FF7F,\r\n\tsteelblue: 0x4682B4,\r\n\ttan: 0xD2B48C,\r\n\tteal: 0x008080,\r\n\tthistle: 0xD8BFD8,\r\n\ttomato: 0xFF6347,\r\n\tturquoise: 0x40E0D0,\r\n\tviolet: 0xEE82EE,\r\n\twheat: 0xF5DEB3,\r\n\twhite: 0xFFFFFF,\r\n\twhitesmoke: 0xF5F5F5,\r\n\tyellow: 0xFFFF00,\r\n\tyellowgreen: 0x9ACD32,\r\n};\r\n\r\nfor (const name in colorValues) {\r\n\tif (colorValues.hasOwnProperty(name)) {\r\n\t\tconst color = colorValues[name];\r\n\r\n\t\tColorNames[name] = `${Math.floor(color / 65536)},${Math.floor(color / 256 % 256)},${(color % 256)}`;\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Back easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nexport function registerBackIn(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackOut(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (Math.pow(--percentComplete, 2) * ((amount + 1) * percentComplete + amount) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackInOut(name: string, amount: number) {\r\n\tamount *= 1.525;\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tpercentComplete *= 2;\r\n\r\n\t\treturn (percentComplete < 1\r\n\t\t\t? (Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount))\r\n\t\t\t: (Math.pow(percentComplete - 2, 2) * ((amount + 1) * (percentComplete - 2) + amount) + 2)\r\n\t\t) * 0.5 * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterBackIn(\"easeInBack\", 1.7);\r\nregisterBackOut(\"easeOutBack\", 1.7);\r\nregisterBackInOut(\"easeInOutBack\", 1.7);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bounce easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nfunction easeOutBouncePercent(percentComplete: number): number {\r\n\tif (percentComplete < 1 / 2.75) {\r\n\t\treturn (7.5625 * percentComplete * percentComplete);\r\n\t}\r\n\tif (percentComplete < 2 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 1.5 / 2.75) * percentComplete + 0.75);\r\n\t}\r\n\tif (percentComplete < 2.5 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 2.25 / 2.75) * percentComplete + 0.9375);\r\n\t}\r\n\r\n\treturn (7.5625 * (percentComplete -= 2.625 / 2.75) * percentComplete + 0.984375);\r\n}\r\n\r\nfunction easeInBouncePercent(percentComplete: number): number {\r\n\treturn 1 - easeOutBouncePercent(1 - percentComplete);\r\n}\r\n\r\nexport function easeInBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeInBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeOutBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeInOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn (percentComplete < 0.5\r\n\t\t? easeInBouncePercent(percentComplete * 2) * 0.5\r\n\t\t: easeOutBouncePercent(percentComplete * 2 - 1) * 0.5 + 0.5\r\n\t) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"easeInBounce\", easeInBounce]);\r\nregisterEasing([\"easeOutBounce\", easeOutBounce]);\r\nregisterEasing([\"easeInOutBounce\", easeInOutBounce]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Elastic easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n// Constants\r\nconst PI2 = Math.PI * 2;\r\n\r\nexport function registerElasticIn(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn -(amplitude * Math.pow(2, 10 * (percentComplete -= 1)) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period)) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticInOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tconst s = period / PI2 * Math.asin(1 / amplitude);\r\n\r\n\t\tpercentComplete = percentComplete * 2 - 1;\r\n\r\n\t\treturn (percentComplete < 0\r\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period))\r\n\t\t\t: amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period) * 0.5 + 1\r\n\t\t) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterElasticIn(\"easeInElastic\", 1, 0.3);\r\nregisterElasticOut(\"easeOutElastic\", 1, 0.3);\r\nregisterElasticInOut(\"easeInOutElastic\", 1, 0.3 * 1.5);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Easings to act on strings, either set at the start or at the end depending on\r\n * need.\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Easing function that sets to the specified value immediately after the\r\n * animation starts.\r\n */\r\nexport function atStart(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value while the animation is\r\n * running.\r\n */\r\nexport function during(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0 || percentComplete === 1\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value when the animation ends.\r\n */\r\nexport function atEnd(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 1\r\n\t\t? endValue\r\n\t\t: startValue;\r\n}\r\n\r\nregisterEasing([\"at-start\", atStart]);\r\nregisterEasing([\"during\", during]);\r\nregisterEasing([\"at-end\", atEnd]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {augmentDimension} from \"../css/augmentDimension\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get/set the inner/outer dimension.\r\n */\r\nfunction getDimension(name: \"width\" | \"height\", wantInner: boolean) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn augmentDimension(element, name, wantInner) + \"px\";\r\n\t\t}\r\n\t\tsetPropertyValue(element, name, (parseFloat(propertyValue) - augmentDimension(element, name, wantInner)) + \"px\");\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"innerWidth\", getDimension(\"width\", true)]);\r\nregisterNormalization([\"Element\", \"innerHeight\", getDimension(\"height\", true)]);\r\nregisterNormalization([\"Element\", \"outerWidth\", getDimension(\"width\", false)]);\r\nregisterNormalization([\"Element\", \"outerHeight\", getDimension(\"height\", false)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {Data} from \"../data\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n// Constants\r\nexport const inlineRx = /^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|let|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i,\r\n\tlistItemRx = /^(li)$/i,\r\n\ttableRowRx = /^(tr)$/i,\r\n\ttableRx = /^(table)$/i,\r\n\ttableRowGroupRx = /^(tbody)$/i;\r\n\r\n/**\r\n * Display has an extra value of \"auto\" that works out the correct value\r\n * based on the type of element.\r\n */\r\nfunction display(element: HTMLorSVGElement): string;\r\nfunction display(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction display(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tconst style = element.style;\r\n\r\n\tif (propertyValue === undefined) {\r\n\t\treturn computePropertyValue(element, \"display\");\r\n\t}\r\n\tif (propertyValue === \"auto\") {\r\n\t\tconst nodeName = element && element.nodeName,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (inlineRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"inline\";\r\n\t\t} else if (listItemRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"list-item\";\r\n\t\t} else if (tableRowRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row\";\r\n\t\t} else if (tableRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table\";\r\n\t\t} else if (tableRowGroupRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row-group\";\r\n\t\t} else {\r\n\t\t\t// Default to \"block\" when no match is found.\r\n\t\t\tpropertyValue = \"block\";\r\n\t\t}\r\n\t\t// IMPORTANT: We need to do this as getPropertyValue bypasses the\r\n\t\t// Normalisation when it exists in the cache.\r\n\t\tdata.cache[\"display\"] = propertyValue;\r\n\t}\r\n\tstyle.display = propertyValue;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"display\", display]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction clientWidth(element: HTMLorSVGElement): string;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction scrollWidth(element: HTMLorSVGElement): string;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction clientHeight(element: HTMLorSVGElement): string;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction scrollHeight(element: HTMLorSVGElement): string;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Scroll an element.\r\n */\r\nfunction scroll(direction: \"Height\", end: \"Top\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Width\", end: \"Left\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Height\" | \"Width\", end: \"Top\" | \"Left\"): VelocityNormalizationsFn {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue == null) {\r\n\t\t\t// Make sure we have these values cached.\r\n\t\t\tgetPropertyValue(element, \"client\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + end, null, true);\r\n\r\n\t\t\treturn element[\"scroll\" + end] + \"px\";\r\n\t\t}\r\n\t\tconst value = parseFloat(propertyValue),\r\n\t\t\tunit = propertyValue.replace(String(value), \"\");\r\n\r\n\t\tswitch (unit) {\r\n\t\t\tcase \"\":\r\n\t\t\tcase \"px\":\r\n\t\t\t\telement[\"scroll\" + end] = value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"%\":\r\n\t\t\t\tconst client = parseFloat(getPropertyValue(element, \"client\" + direction)),\r\n\t\t\t\t\tscrollValue = parseFloat(getPropertyValue(element, \"scroll\" + direction));\r\n\r\n\t\t\t\telement[\"scroll\" + end] = Math.max(0, scrollValue - client) * value / 100;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"HTMLElement\", \"scroll\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollTop\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollLeft\", scroll(\"Width\", \"Left\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollWidth\", scrollWidth]);\r\nregisterNormalization([\"HTMLElement\", \"clientWidth\", clientWidth]);\r\nregisterNormalization([\"HTMLElement\", \"scrollHeight\", scrollHeight]);\r\nregisterNormalization([\"HTMLElement\", \"clientHeight\", clientHeight]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * This handles all CSS style properties. With browser prefixed properties it\r\n * will register a version that handles setting (and getting) both the prefixed\r\n * and non-prefixed version.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {ALL_VENDOR_PREFIXES} from \"../../constants\";\r\nimport {isString} from \"../../types\";\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {State} from \"../state\";\r\nimport {hasNormalization, registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * An RegExp pattern for the following list of css words using\r\n * http://kemio.com.ar/tools/lst-trie-re.php to generate:\r\n *\r\n * blockSize\r\n * borderBottomLeftRadius\r\n * borderBottomRightRadius\r\n * borderBottomWidth\r\n * borderImageOutset\r\n * borderImageWidth\r\n * borderLeftWidth\r\n * borderRadius\r\n * borderRightWidth\r\n * borderSpacing\r\n * borderTopLeftRadius\r\n * borderTopRightRadius\r\n * borderTopWidth\r\n * borderWidth\r\n * bottom\r\n * columnGap\r\n * columnRuleWidth\r\n * columnWidth\r\n * flexBasis\r\n * fontSize\r\n * gridColumnGap\r\n * gridGap\r\n * gridRowGap\r\n * height\r\n * inlineSize\r\n * left\r\n * letterSpacing\r\n * margin\r\n * marginBottom\r\n * marginLeft\r\n * marginRight\r\n * marginTop\r\n * maxBlockSize\r\n * maxHeight\r\n * maxInlineSize\r\n * maxWidth\r\n * minBlockSize\r\n * minHeight\r\n * minInlineSize\r\n * minWidth\r\n * objectPosition\r\n * outlineOffset\r\n * outlineWidth\r\n * padding\r\n * paddingBottom\r\n * paddingLeft\r\n * paddingRight\r\n * paddingTop\r\n * perspective\r\n * right\r\n * shapeMargin\r\n * strokeDashoffset\r\n * strokeWidth\r\n * textIndent\r\n * top\r\n * transformOrigin\r\n * width\r\n * wordSpacing\r\n */\r\n// tslint:disable-next-line:max-line-length\r\nconst rxAddPx = /^(b(lockSize|o(rder(Bottom(LeftRadius|RightRadius|Width)|Image(Outset|Width)|LeftWidth|R(adius|ightWidth)|Spacing|Top(LeftRadius|RightRadius|Width)|Width)|ttom))|column(Gap|RuleWidth|Width)|f(lexBasis|ontSize)|grid(ColumnGap|Gap|RowGap)|height|inlineSize|le(ft|tterSpacing)|m(a(rgin(Bottom|Left|Right|Top)|x(BlockSize|Height|InlineSize|Width))|in(BlockSize|Height|InlineSize|Width))|o(bjectPosition|utline(Offset|Width))|p(adding(Bottom|Left|Right|Top)|erspective)|right|s(hapeMargin|troke(Dashoffset|Width))|t(extIndent|op|ransformOrigin)|w(idth|ordSpacing))$/;\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a prefixed style\r\n * property.\r\n */\r\nfunction getSetPrefixed(propertyName: string, unprefixed: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName) || computePropertyValue(element, unprefixed);\r\n\t\t}\r\n\t\telement.style[propertyName] = element.style[unprefixed] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a style property.\r\n */\r\nfunction getSetStyle(propertyName: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName);\r\n\t\t}\r\n\t\telement.style[propertyName] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Vendor prefixes. Chrome / Safari, Firefox, IE / Edge, Opera.\r\n */\r\nconst rxVendors = /^(webkit|moz|ms|o)[A-Z]/,\r\n\tprefixElement = State.prefixElement;\r\n\r\nfor (const propertyName in prefixElement.style) {\r\n\tif (rxVendors.test(propertyName)) {\r\n\t\tconst unprefixed = propertyName.replace(/^[a-z]+([A-Z])/, ($, letter: string) => letter.toLowerCase());\r\n\r\n\t\tif (ALL_VENDOR_PREFIXES || isString(prefixElement.style[unprefixed])) {\r\n\t\t\tconst addUnit = rxAddPx.test(unprefixed) ? \"px\" : undefined;\r\n\r\n\t\t\tregisterNormalization([\"Element\", unprefixed, getSetPrefixed(propertyName, unprefixed), addUnit]);\r\n\t\t}\r\n\t} else if (!hasNormalization([\"Element\", propertyName])) {\r\n\t\tconst addUnit = rxAddPx.test(propertyName) ? \"px\" : undefined;\r\n\r\n\t\tregisterNormalization([\"Element\", propertyName, getSetStyle(propertyName), addUnit]);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../../types\";\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set an attribute.\r\n */\r\nfunction getAttribute(name: string) {\r\n\treturn ((element: Element, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn element.getAttribute(name);\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nconst base = document.createElement(\"div\"),\r\n\trxSubtype = /^SVG(.*)Element$/,\r\n\trxElement = /Element$/;\r\n\r\nObject.getOwnPropertyNames(window)\r\n\t.forEach((property) => {\r\n\t\tconst subtype = rxSubtype.exec(property);\r\n\r\n\t\tif (subtype && subtype[1] !== \"SVG\") { // Don't do SVGSVGElement.\r\n\t\t\ttry {\r\n\t\t\t\tconst element = subtype[1] ? document.createElementNS(\"http://www.w3.org/2000/svg\", (subtype[1] || \"svg\").toLowerCase()) : document.createElement(\"svg\");\r\n\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const attribute in element) {\r\n\t\t\t\t\t// Although this isn't a tween without prototypes, we do\r\n\t\t\t\t\t// want to get hold of all attributes and not just own ones.\r\n\t\t\t\t\tconst value = element[attribute];\r\n\r\n\t\t\t\t\tif (isString(attribute)\r\n\t\t\t\t\t\t&& !(attribute[0] === \"o\" && attribute[1] === \"n\")\r\n\t\t\t\t\t\t&& attribute !== attribute.toUpperCase()\r\n\t\t\t\t\t\t&& !rxElement.test(attribute)\r\n\t\t\t\t\t\t&& !(attribute in base)\r\n\t\t\t\t\t\t&& !isFunction(value)) {\r\n\t\t\t\t\t\t// TODO: Should this all be set on the generic SVGElement, it would save space and time, but not as powerful\r\n\t\t\t\t\t\tregisterNormalization([property, attribute, getAttribute(attribute)]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.error(`VelocityJS: Error when trying to identify SVG attributes on ${property}.`, e);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set the width or height.\r\n */\r\nfunction getDimension(name: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\t// Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM.\r\n\t\t\ttry {\r\n\t\t\t\treturn (element as SVGGraphicsElement).getBBox()[name] + \"px\";\r\n\t\t\t} catch (e) {\r\n\t\t\t\treturn \"0px\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"SVGElement\", \"width\", getDimension(\"width\")]);\r\nregisterNormalization([\"SVGElement\", \"height\", getDimension(\"height\")]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * A fake normalization used to allow the \"tween\" property easy access.\r\n */\r\nfunction getSetTween(element: HTMLorSVGElement, propertyValue?: string) {\r\n\tif (propertyValue === undefined) {\r\n\t\treturn \"\";\r\n\t}\r\n}\r\n\r\nregisterNormalization([\"Element\", \"tween\", getSetTween]);\r\n","/*\n * velocity-animate (C) 2014-2017 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Automatically generated\nexport const VERSION = \"2.0.3\";\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, SequenceList, VelocitySequence, VelocityTween} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../types\";\r\nimport Velocity from \"../velocity\";\r\nimport {registerAction} from \"./actions/actions\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {getNormalization} from \"./normalizations/normalizations\";\r\nimport {validateDuration, validateEasing} from \"./options\";\r\nimport {SequencesObject} from \"./sequencesObject\";\r\nimport {findPattern} from \"./tweens\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../constants\";\r\n\r\nconst rxPercents = /(\\d*\\.\\d+|\\d+\\.?|from|to)/g;\r\n\r\nexport function expandSequence(animation: AnimationCall, sequence: SequenceList) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telement = animation.element;\r\n\r\n\tfor (const propertyName in sequence.tweens) {\r\n\t\tif (sequence.tweens.hasOwnProperty(propertyName)) {\r\n\t\t\tconst fn = getNormalization(element, propertyName);\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping [${propertyName}] due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttweens[propertyName] = {\r\n\t\t\t\tfn,\r\n\t\t\t\tsequence: sequence.tweens[propertyName],\r\n\t\t\t} as VelocityTween;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to register a sequence. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerSequence\", \"\"name\", VelocitySequence);\r\n */\r\nexport function registerSequence(args?: [string, VelocitySequence] | [{[name: string]: VelocitySequence}]) {\r\n\tif (isPlainObject(args[0])) {\r\n\t\tfor (const name in (args[0] as {[name: string]: VelocitySequence})) {\r\n\t\t\tif (args[0].hasOwnProperty(name)) {\r\n\t\t\t\tregisterSequence([name, args[0][name]]);\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(args[0])) {\r\n\t\tconst name = args[0] as string,\r\n\t\t\tsequence = args[1] as VelocitySequence;\r\n\r\n\t\tif (!isString(name)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' name to an invalid value:`, name);\r\n\t\t} else if (!isPlainObject(sequence)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' sequence to an invalid value:`, name, sequence);\r\n\t\t} else {\r\n\t\t\tif (SequencesObject[name]) {\r\n\t\t\t\tconsole.warn(`VelocityJS: Replacing named sequence:`, name);\r\n\t\t\t}\r\n\t\t\tconst percents: {[key: string]: string[]} = {},\r\n\t\t\t\tsteps: string[] = new Array(100),\r\n\t\t\t\tproperties: string[] = [],\r\n\t\t\t\tpercentages: string[] = [],\r\n\t\t\t\tsequenceList: SequenceList = SequencesObject[name] = {} as any,\r\n\t\t\t\tduration = validateDuration((sequence as any).duration);\r\n\r\n\t\t\tsequenceList.tweens = {};\r\n\t\t\tif (isNumber(duration)) {\r\n\t\t\t\tsequenceList.duration = duration;\r\n\t\t\t}\r\n\t\t\tfor (const part in sequence) {\r\n\t\t\t\tif (sequence.hasOwnProperty(part)) {\r\n\t\t\t\t\tconst keys = String(part)\r\n\t\t\t\t\t\t.match(rxPercents);\r\n\r\n\t\t\t\t\tif (keys) {\r\n\t\t\t\t\t\tpercentages.push(part);\r\n\t\t\t\t\t\tfor (const key of keys) {\r\n\t\t\t\t\t\t\tconst percent = key === \"from\"\r\n\t\t\t\t\t\t\t\t? 0\r\n\t\t\t\t\t\t\t\t: key === \"to\"\r\n\t\t\t\t\t\t\t\t\t? 100\r\n\t\t\t\t\t\t\t\t\t: parseFloat(key);\r\n\r\n\t\t\t\t\t\t\tif (percent < 0 || percent > 100) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid value as a percentage (0 <= n <= 100):`, name, percent);\r\n\t\t\t\t\t\t\t} else if (isNaN(percent)) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid number as a percentage:`, name, part, key);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (!percents[String(percent)]) {\r\n\t\t\t\t\t\t\t\t\tpercents[String(percent)] = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tpercents[String(percent)].push(part);\r\n\t\t\t\t\t\t\t\tfor (const property in sequence[part]) {\r\n\t\t\t\t\t\t\t\t\tif (!properties.includes(property)) {\r\n\t\t\t\t\t\t\t\t\t\tproperties.push(property);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst orderedPercents = Object.keys(percents)\r\n\t\t\t\t.sort((a, b) => {\r\n\t\t\t\t\tconst a1 = parseFloat(a),\r\n\t\t\t\t\t\tb1 = parseFloat(b);\r\n\r\n\t\t\t\t\treturn a1 > b1 ? 1 : a1 < b1 ? -1 : 0;\r\n\t\t\t\t});\r\n\r\n\t\t\torderedPercents.forEach((key) => {\r\n\t\t\t\tsteps.push.apply(percents[key]);\r\n\t\t\t});\r\n\t\t\tfor (const property of properties) {\r\n\t\t\t\tconst parts: string[] = [],\r\n\t\t\t\t\tpropertyName = camelCase(property);\r\n\r\n\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\tconst stepProperties = sequence[value];\r\n\r\n\t\t\t\t\t\tif (stepProperties[propertyName]) {\r\n\t\t\t\t\t\t\tparts.push(isString(stepProperties[propertyName])\r\n\t\t\t\t\t\t\t\t? stepProperties[propertyName]\r\n\t\t\t\t\t\t\t\t: stepProperties[propertyName][0]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (parts.length) {\r\n\t\t\t\t\tconst realSequence = findPattern(parts, propertyName);\r\n\t\t\t\t\tlet index = 0;\r\n\r\n\t\t\t\t\tif (realSequence) {\r\n\t\t\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\t\t\tconst originalProperty = sequence[value][propertyName];\r\n\r\n\t\t\t\t\t\t\t\tif (originalProperty) {\r\n\t\t\t\t\t\t\t\t\tif (Array.isArray(originalProperty) && originalProperty.length > 1 && (isString(originalProperty[1]) || Array.isArray(originalProperty[1]))) {\r\n\t\t\t\t\t\t\t\t\t\trealSequence[index].easing = validateEasing(originalProperty[1], sequenceList.duration || DEFAULT_DURATION);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\trealSequence[index++].percent = parseFloat(key) / 100;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsequenceList.tweens[propertyName] = realSequence;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerSequence\", registerSequence], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Core \"Velocity\" function.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, StrictVelocityOptions,\r\n\tVelocityElements, VelocityExtended, VelocityObjectArgs, VelocityOptions, VelocityPromise,\r\n\tVelocityProperty, VelocityResult,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean, isFunction, isNode, isPlainObject, isString, isVelocityResult, isWrapped} from \"./types\";\r\nimport {cloneArray, defineProperty, getValue} from \"./utility\";\r\nimport {Data} from \"./Velocity/data\";\r\nimport {\r\n\tvalidateBegin, validateComplete, validateDelay, validateDuration, validateEasing,\r\n\tvalidateLoop, validateProgress, validateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./Velocity/options\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {queue} from \"./Velocity/queue\";\r\nimport {expandSequence} from \"./Velocity/sequences\";\r\nimport {tick} from \"./Velocity/tick\";\r\nimport {expandProperties} from \"./Velocity/tweens\";\r\n\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\n\r\n/* tslint:disable:max-line-length */\r\n/**\r\n * The main Velocity function. Acts as a gateway to everything else.\r\n */\r\nexport function Velocity(options: VelocityObjectArgs): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, options?: VelocityOptions): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\n/* tslint:enable:max-line-length */\r\nexport function Velocity(this: VelocityElements | void, ...argsList: any[]): VelocityResult {\r\n\tconst\r\n\t\t/**\r\n\t\t * A shortcut to the default options.\r\n\t\t */\r\n\t\tdefaults = DefaultObject,\r\n\t\t/**\r\n\t\t * Shortcut to arguments for file size.\r\n\t\t */\r\n\t\targs = arguments,\r\n\t\t/**\r\n\t\t * Cache of the first argument - this is used often enough to be saved.\r\n\t\t */\r\n\t\targs0 = args[0] as VelocityObjectArgs,\r\n\t\t/**\r\n\t\t * To allow for expressive CoffeeScript code, Velocity supports an\r\n\t\t * alternative syntax in which \"elements\" (or \"e\"), \"properties\" (or\r\n\t\t * \"p\"), and \"options\" (or \"o\") objects are defined on a container\r\n\t\t * object that's passed in as Velocity's sole argument.\r\n\t\t *\r\n\t\t * Note: Some browsers automatically populate arguments with a\r\n\t\t * \"properties\" object. We detect it by checking for its default\r\n\t\t * \"names\" property.\r\n\t\t */\r\n\t\t// TODO: Confirm which browsers - if <=IE8 the we can drop completely\r\n\t\tsyntacticSugar = isPlainObject(args0) && (args0.p || ((isPlainObject(args0.properties) && !(args0.properties as any).names) || isString(args0.properties)));\r\n\tlet\r\n\t\t/**\r\n\t\t * When Velocity is called via the utility function (Velocity()),\r\n\t\t * elements are explicitly passed in as the first parameter. Thus,\r\n\t\t * argument positioning varies.\r\n\t\t */\r\n\t\targumentIndex: number = 0,\r\n\t\t/**\r\n\t\t * The list of elements, extended with Promise and Velocity.\r\n\t\t */\r\n\t\telements: VelocityResult,\r\n\t\t/**\r\n\t\t * The properties being animated. This can be a string, in which case it\r\n\t\t * is either a function for these elements, or it is a \"named\" animation\r\n\t\t * sequence to use instead. Named sequences start with either \"callout.\"\r\n\t\t * or \"transition.\". When used as a callout the values will be reset\r\n\t\t * after finishing. When used as a transtition then there is no special\r\n\t\t * handling after finishing.\r\n\t\t */\r\n\t\tpropertiesMap: string | Properties,\r\n\t\t/**\r\n\t\t * Options supplied, this will be mapped and validated into\r\n\t\t * options.\r\n\t\t */\r\n\t\toptionsMap: VelocityOptions,\r\n\t\t/**\r\n\t\t * If called via a chain then this contains the last calls\r\n\t\t * animations. If this does not have a value then any access to the\r\n\t\t * element's animations needs to be to the currently-running ones.\r\n\t\t */\r\n\t\tanimations: AnimationCall[],\r\n\t\t/**\r\n\t\t * The promise that is returned.\r\n\t\t */\r\n\t\tpromise: Promise,\r\n\t\t// Used when the animation is finished\r\n\t\tresolver: (value?: VelocityResult) => void,\r\n\t\t// Used when there was an issue with one or more of the Velocity arguments\r\n\t\trejecter: (reason: any) => void;\r\n\r\n\t//console.log(`Velocity`, _arguments)\r\n\t// First get the elements, and the animations connected to the last call if\r\n\t// this is chained.\r\n\t// TODO: Clean this up a bit\r\n\t// TODO: Throw error if the chain is called with elements as the first argument. isVelocityResult(this) && ( (isNode(arg0) || isWrapped(arg0)) && arg0 == this)\r\n\tif (isNode(this)) {\r\n\t\t// This is from a chain such as document.getElementById(\"\").velocity(...)\r\n\t\telements = [this as HTMLorSVGElement] as VelocityResult;\r\n\t} else if (isWrapped(this)) {\r\n\t\t// This might be a chain from something else, but if chained from a\r\n\t\t// previous Velocity() call then grab the animations it's related to.\r\n\t\telements = cloneArray(this as HTMLorSVGElement[]) as VelocityResult;\r\n\t\tif (isVelocityResult(this)) {\r\n\t\t\tanimations = (this as VelocityResult).velocity.animations;\r\n\t\t}\r\n\t} else if (syntacticSugar) {\r\n\t\telements = cloneArray(args0.elements || args0.e) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isNode(args0)) {\r\n\t\telements = cloneArray([args0]) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isWrapped(args0)) {\r\n\t\telements = cloneArray(args0) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t}\r\n\t// Allow elements to be chained.\r\n\tif (elements) {\r\n\t\tdefineProperty(elements, \"velocity\", Velocity.bind(elements));\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t// Next get the propertiesMap and options.\r\n\tif (syntacticSugar) {\r\n\t\tpropertiesMap = getValue(args0.properties, args0.p);\r\n\t} else {\r\n\t\t// TODO: Should be possible to call Velocity(\"pauseAll\") - currently not possible\r\n\t\tpropertiesMap = args[argumentIndex++] as string | Properties;\r\n\t}\r\n\t// Get any options map passed in as arguments first, expand any direct\r\n\t// options if possible.\r\n\tconst isReverse = propertiesMap === \"reverse\",\r\n\t\tisAction = !isReverse && isString(propertiesMap),\r\n\t\tmaybeSequence = isAction && SequencesObject[propertiesMap as string],\r\n\t\topts = syntacticSugar ? getValue(args0.options, args0.o) : args[argumentIndex];\r\n\r\n\tif (isPlainObject(opts)) {\r\n\t\toptionsMap = opts;\r\n\t}\r\n\t// Create the promise if supported and wanted.\r\n\tif (Promise && getValue(optionsMap && optionsMap.promise, defaults.promise)) {\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\trejecter = reject;\r\n\t\t\t// IMPORTANT:\r\n\t\t\t// If a resolver tries to run on a Promise then it will wait until\r\n\t\t\t// that Promise resolves - but in this case we're running on our own\r\n\t\t\t// Promise, so need to make sure it's not seen as one. Setting these\r\n\t\t\t// values to undefined for the duration of the resolve.\r\n\t\t\t// Due to being an async call, they should be back to \"normal\"\r\n\t\t\t// before the .then() function gets called.\r\n\t\t\tresolver = (result: VelocityResult) => {\r\n\t\t\t\tif (isVelocityResult(result) && result.then) {\r\n\t\t\t\t\tconst then = result.then;\r\n\r\n\t\t\t\t\tresult.then = undefined; // Preserving enumeration etc\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t\tresult.then = then;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t});\r\n\t\tif (elements) {\r\n\t\t\tdefineProperty(elements, \"promise\", promise);\r\n\t\t\tdefineProperty(elements, \"then\", promise.then.bind(promise));\r\n\t\t\tdefineProperty(elements, \"catch\", promise.catch.bind(promise));\r\n\t\t\tif ((promise as any).finally) {\r\n\t\t\t\t// Semi-standard\r\n\t\t\t\tdefineProperty(elements, \"finally\", (promise as any).finally.bind(promise));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst promiseRejectEmpty: boolean = getValue(optionsMap && optionsMap.promiseRejectEmpty, defaults.promiseRejectEmpty);\r\n\r\n\tif (promise) {\r\n\t\tif (!elements && !isAction) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No elements supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t} else if (!propertiesMap) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No properties supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ((!elements && !isAction) || !propertiesMap) {\r\n\t\treturn promise as any;\r\n\t}\r\n\r\n\t// NOTE: Can't use isAction here due to type inference - there are callbacks\r\n\t// between so the type isn't considered safe.\r\n\tif (isAction) {\r\n\t\tconst actionArgs: any[] = [],\r\n\t\t\tpromiseHandler: VelocityPromise = promise && {\r\n\t\t\t\t_promise: promise,\r\n\t\t\t\t_resolver: resolver,\r\n\t\t\t\t_rejecter: rejecter,\r\n\t\t\t};\r\n\r\n\t\twhile (argumentIndex < args.length) {\r\n\t\t\tactionArgs.push(args[argumentIndex++]);\r\n\t\t}\r\n\r\n\t\t// Velocity's behavior is categorized into \"actions\". If a string is\r\n\t\t// passed in instead of a propertiesMap then that will call a function\r\n\t\t// to do something special to the animation linked.\r\n\t\t// There is one special case - \"reverse\" - which is handled differently,\r\n\t\t// by being stored on the animation and then expanded when the animation\r\n\t\t// starts.\r\n\t\tconst action = (propertiesMap as string).replace(/\\..*$/, \"\"),\r\n\t\t\tcallback = ActionsObject[action];\r\n\r\n\t\tif (callback) {\r\n\t\t\tconst result = callback(actionArgs, elements, promiseHandler, propertiesMap as string);\r\n\r\n\t\t\tif (result !== undefined) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\r\n\t\t\treturn elements || promise as any;\r\n\t\t} else if (!maybeSequence) {\r\n\t\t\tconsole.error(`VelocityJS: First argument (${propertiesMap}) was not a property map, a known action, or a registered redirect. Aborting.`);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tlet hasValidDuration: boolean;\r\n\r\n\tif (isPlainObject(propertiesMap) || isReverse || maybeSequence) {\r\n\t\t/**\r\n\t\t * The options for this set of animations.\r\n\t\t */\r\n\t\tconst options: StrictVelocityOptions = {};\r\n\t\tlet isSync = defaults.sync;\r\n\r\n\t\t// Private options first - set as non-enumerable, and starting with an\r\n\t\t// underscore so we can filter them out.\r\n\t\tif (promise) {\r\n\t\t\tdefineProperty(options, \"_promise\", promise);\r\n\t\t\tdefineProperty(options, \"_rejecter\", rejecter);\r\n\t\t\tdefineProperty(options, \"_resolver\", resolver);\r\n\t\t}\r\n\t\tdefineProperty(options, \"_ready\", 0);\r\n\t\tdefineProperty(options, \"_started\", 0);\r\n\t\tdefineProperty(options, \"_completed\", 0);\r\n\t\tdefineProperty(options, \"_total\", 0);\r\n\r\n\t\t// Now check the optionsMap\r\n\t\tif (isPlainObject(optionsMap)) {\r\n\t\t\tconst validDuration = validateDuration(optionsMap.duration);\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\toptions.duration = getValue(validDuration, defaults.duration);\r\n\t\t\toptions.delay = getValue(validateDelay(optionsMap.delay), defaults.delay);\r\n\t\t\t// Need the extra fallback here in case it supplies an invalid\r\n\t\t\t// easing that we need to overrride with the default.\r\n\t\t\toptions.easing = validateEasing(getValue(optionsMap.easing, defaults.easing), options.duration) || validateEasing(defaults.easing, options.duration);\r\n\t\t\toptions.loop = getValue(validateLoop(optionsMap.loop), defaults.loop);\r\n\t\t\toptions.repeat = options.repeatAgain = getValue(validateRepeat(optionsMap.repeat), defaults.repeat);\r\n\t\t\tif (optionsMap.speed != null) {\r\n\t\t\t\toptions.speed = getValue(validateSpeed(optionsMap.speed), 1);\r\n\t\t\t}\r\n\t\t\tif (isBoolean(optionsMap.promise)) {\r\n\t\t\t\toptions.promise = optionsMap.promise;\r\n\t\t\t}\r\n\t\t\toptions.queue = getValue(validateQueue(optionsMap.queue), defaults.queue);\r\n\t\t\tif (optionsMap.mobileHA && !StateObject.isGingerbread) {\r\n\t\t\t\t/* When set to true, and if this is a mobile device, mobileHA automatically enables hardware acceleration (via a null transform hack)\r\n\t\t\t\t on animating elements. HA is removed from the element at the completion of its animation. */\r\n\t\t\t\t/* Note: Android Gingerbread doesn't support HA. If a null transform hack (mobileHA) is in fact set, it will prevent other tranform subproperties from taking effect. */\r\n\t\t\t\t/* Note: You can read more about the use of mobileHA in Velocity's documentation: velocity-animate/#mobileHA. */\r\n\t\t\t\toptions.mobileHA = true;\r\n\t\t\t}\r\n\t\t\tif (!isReverse) {\r\n\t\t\t\tif (optionsMap.display != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).display = optionsMap.display as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.display\" used, this is now a property:`, optionsMap.display);\r\n\t\t\t\t}\r\n\t\t\t\tif (optionsMap.visibility != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).visibility = optionsMap.visibility as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.visibility\" used, this is now a property:`, optionsMap.visibility);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: Allow functional options for different options per element\r\n\t\t\tconst optionsBegin = validateBegin(optionsMap.begin),\r\n\t\t\t\toptionsComplete = validateComplete(optionsMap.complete),\r\n\t\t\t\toptionsProgress = validateProgress(optionsMap.progress),\r\n\t\t\t\toptionsSync = validateSync(optionsMap.sync);\r\n\r\n\t\t\tif (optionsBegin != null) {\r\n\t\t\t\toptions.begin = optionsBegin;\r\n\t\t\t}\r\n\t\t\tif (optionsComplete != null) {\r\n\t\t\t\toptions.complete = optionsComplete;\r\n\t\t\t}\r\n\t\t\tif (optionsProgress != null) {\r\n\t\t\t\toptions.progress = optionsProgress;\r\n\t\t\t}\r\n\t\t\tif (optionsSync != null) {\r\n\t\t\t\tisSync = optionsSync;\r\n\t\t\t}\r\n\t\t} else if (!syntacticSugar) {\r\n\t\t\t// Expand any direct options if possible.\r\n\t\t\tconst validDuration = validateDuration(args[argumentIndex], true);\r\n\t\t\tlet offset = 0;\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\tif (validDuration !== undefined) {\r\n\t\t\t\toffset++;\r\n\t\t\t\toptions.duration = validDuration;\r\n\t\t\t}\r\n\t\t\tif (!isFunction(args[argumentIndex + offset])) {\r\n\t\t\t\t// Despite coming before Complete, we can't pass a fn easing\r\n\t\t\t\tconst easing = validateEasing(args[argumentIndex + offset], getValue(options && validateDuration(options.duration), defaults.duration) as number, true);\r\n\r\n\t\t\t\tif (easing !== undefined) {\r\n\t\t\t\t\toffset++;\r\n\t\t\t\t\toptions.easing = easing;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst complete = validateComplete(args[argumentIndex + offset], true);\r\n\r\n\t\t\tif (complete !== undefined) {\r\n\t\t\t\toptions.complete = complete;\r\n\t\t\t}\r\n\t\t\toptions.loop = defaults.loop;\r\n\t\t\toptions.repeat = options.repeatAgain = defaults.repeat;\r\n\t\t}\r\n\r\n\t\tif (isReverse && options.queue === false) {\r\n\t\t\tthrow new Error(\"VelocityJS: Cannot reverse a queue:false animation.\");\r\n\t\t}\r\n\r\n\t\tif (maybeSequence && !hasValidDuration && maybeSequence.duration) {\r\n\t\t\toptions.duration = maybeSequence.duration;\r\n\t\t}\r\n\r\n\t\t// When a set of elements is targeted by a Velocity call, the set is\r\n\t\t// broken up and each element has the current Velocity call individually\r\n\t\t// queued onto it. In this way, each element's existing queue is\r\n\t\t// respected; some elements may already be animating and accordingly\r\n\t\t// should not have this current Velocity call triggered immediately\r\n\t\t// unless the sync:true option is used.\r\n\r\n\t\tconst rootAnimation: AnimationCall = {\r\n\t\t\toptions,\r\n\t\t\telements,\r\n\t\t\t_prev: undefined,\r\n\t\t\t_next: undefined,\r\n\t\t\t_flags: isSync ? AnimationFlags.SYNC : 0,\r\n\t\t\tpercentComplete: 0,\r\n\t\t\tellapsedTime: 0,\r\n\t\t\ttimeStart: 0,\r\n\t\t};\r\n\r\n\t\tanimations = [];\r\n\t\tfor (const element of elements) {\r\n\t\t\tlet flags = 0;\r\n\r\n\t\t\tif (isNode(element)) { // TODO: This needs to check for valid animation targets, not just Elements\r\n\t\t\t\tif (isReverse) {\r\n\t\t\t\t\tconst lastAnimation = Data(element).lastAnimationList[options.queue as string];\r\n\r\n\t\t\t\t\tpropertiesMap = lastAnimation && lastAnimation.tweens;\r\n\t\t\t\t\tif (!propertiesMap) {\r\n\t\t\t\t\t\tconsole.error(`VelocityJS: Attempting to reverse an animation on an element with no previous animation:`, element);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tflags |= AnimationFlags.REVERSE & ~(lastAnimation._flags & AnimationFlags.REVERSE); // tslint:disable-line:no-bitwise\r\n\t\t\t\t}\r\n\t\t\t\tconst animation: AnimationCall = {\r\n\t\t\t\t\t...rootAnimation,\r\n\t\t\t\t\telement,\r\n\t\t\t\t\t_flags: rootAnimation._flags | flags, // tslint:disable-line:no-bitwise\r\n\t\t\t\t};\r\n\r\n\t\t\t\toptions._total++;\r\n\t\t\t\tanimations.push(animation);\r\n\t\t\t\tif (maybeSequence) {\r\n\t\t\t\t\texpandSequence(animation, maybeSequence);\r\n\t\t\t\t} else if (isReverse) {\r\n\t\t\t\t\t// In this case we're using the previous animation, so\r\n\t\t\t\t\t// it will be expanded correctly when that one runs.\r\n\t\t\t\t\tanimation.tweens = propertiesMap as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tanimation.tweens = Object.create(null);\r\n\t\t\t\t\texpandProperties(animation, propertiesMap);\r\n\t\t\t\t}\r\n\t\t\t\tqueue(element, animation, options.queue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (StateObject.isTicking === false) {\r\n\t\t\t// If the animation tick isn't running, start it. (Velocity shuts it\r\n\t\t\t// off when there are no active calls to process.)\r\n\t\t\ttick(false);\r\n\t\t}\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t/***************\r\n\t Chaining\r\n\t ***************/\r\n\r\n\t/* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */\r\n\treturn elements || promise as any;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {defineProperty} from \"../utility\";\r\nimport {Velocity} from \"../velocityFn\";\r\n\r\n/**\r\n * Used to patch any object to allow Velocity chaining. In order to chain an\r\n * object must either be treatable as an array - with a .length\r\n * property, and each member a Node, or a Node directly.\r\n *\r\n * By default Velocity will try to patch window,\r\n * jQuery, Zepto, and several classes that return\r\n * Nodes or lists of Nodes.\r\n */\r\nexport function patch(proto: any, global?: boolean) {\r\n\ttry {\r\n\t\tdefineProperty(proto, (global ? \"V\" : \"v\") + \"elocity\", Velocity);\r\n\t} catch (e) {\r\n\t\tconsole.warn(`VelocityJS: Error when trying to add prototype.`, e);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n"],"names":["variable","Object","prototype","toString","call","nodeType","proto","getPrototypeOf","hasOwnProperty","constructor","isNumber","length","isFunction","velocity","window","isString","isNode","obj","property","propertyIsEnumerable","element","className","Element","classList","add","arrayLike","Array","slice","name","value","readonly","defineProperty","args","arguments","arg","undefined","now","Date","getTime","remove","replace","RegExp","Actions","internal","callback","warn","registerAction","DURATION_FAST","DURATION_NORMAL","DURATION_SLOW","FUZZY_MS_PER_SECOND","DEFAULT_CACHE","DEFAULT_DELAY","DEFAULT_DURATION","DEFAULT_EASING","DEFAULT_FPSLIMIT","DEFAULT_LOOP","DEFAULT_PROMISE","DEFAULT_PROMISE_REJECT_EMPTY","DEFAULT_QUEUE","DEFAULT_REPEAT","DEFAULT_SPEED","DEFAULT_SYNC","CLASSNAME","Duration","Easings","registerEasing","percentComplete","startValue","endValue","Math","cos","PI","exp","linearEasing","swingEasing","springEasing","num","min","max","aA1","aA2","aT","A","B","C","mX1","mY1","mX2","mY2","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","i","isNaN","isFinite","fixRange","mSampleValues","Float32Array","aX","aGuessT","currentSlope","getSlope","currentX","calcBezier","aA","aB","currentT","abs","lastSample","intervalStart","currentSample","dist","guessForT","initialSlope","newtonRaphsonIterate","binarySubdivide","precomputed","str","f","getTForX","getControlPoints","x","y","easeIn","generateBezier","easeOut","easeInOut","state","tension","friction","v","initialState","dt","derivative","dx","dv","springAccelerationForState","a","b","springEvaluateStateWithDerivative","c","d","dxdt","dvdt","duration","initState","parseFloat","path","tolerance","DT","haveDuration","timeLapsed","lastState","generateSpringRK4","springIntegrateState","push","floor","cache","steps","fn","round","def","toLowerCase","parseDuration","isBoolean","noError","parsed","error","isArray","generateStep","apply","parseInt","defaults","begin","complete","delay","easing","fpsLimit","loop","mobileHA","minFrameTime","promise","promiseRejectEmpty","queue","repeat","speed","sync","defineProperties","validateEasing","validateCache","validateBegin","validateComplete","validateDelay","validateDuration","validateFpsLimit","validateLoop","validatePromise","validatePromiseRejectEmpty","validateQueue","validateRepeat","validateSpeed","validateSync","reset","Normalizations","NormalizationUnits","NoCacheNormalizations","Set","constructors","constructorCache","Map","dataName","data","ownerDocument","defaultView","types","index","newData","isClient","windowScrollAnchor","pageYOffset","State","test","navigator","userAgent","chrome","document","createElement","documentElement","body","parentNode","animation","prev","last","_prev","_next","first","firstNew","Data","count","queueName","lastAnimationList","queueList","skip","next","options","activeCall","elements","getValue","isLoop","isRepeat","isStopped","_flags","repeatAgain","lastFinishList","timeStart","ellapsedTime","_completed","_total","resolver","_resolver","indexOf","nextArg","has","get","set","unit","units","includes","propertyName","registerNormalization","hasNormalization","propertyValue","noCache","getNormalization","Velocity","debug","info","fixed","$","letter","toUpperCase","rxColor6","rxColor3","rxColorName","rxRGB","rxSpaces","ColorNames","ignore","r","g","makeRGBA","$0","$1","$2","wantInner","isBorderBox","getPropertyValue","sides","fields","augment","field","getBoundingClientRect","augmentDimension","computedStyle","getComputedStyle","computedValue","getWidthHeight","String","style","position","topLeft","skipCache","rxHex","commands","elementArrayIndex","tween","getNormalizationUnit","fixColors","properties","tweens","create","camelCase","valueData","log","arr1","arr2","end","start","rxToken","rxNumber","parts","partsLength","tokens","indexes","numbers","part","cloneArray","match","sequence","pattern","addString","text","returnStringType","isDisplay","isVisibility","more","bits","isUnitless","hasNumbers","token","digits","change","changeOrUnit","index2","splice","firstLetter","patternCalc","isComplex","isMaths","bit","substring","inRGB","starting","findPattern","startNumbers","percent","JSON","stringify","timeCurrent","tweenValue","progress","nextCall","firstProgress","_nextProgress","lastTick","firstComplete","_nextComplete","FRAME_TIME","performance","perf","nowOffset","timing","navigationStart","rAFProxy","setTimeout","rAFShim","requestAnimationFrame","ticking","worker","interval","onmessage","e","setInterval","postMessage","Worker","URL","createObjectURL","Blob","workerFn","isMobile","hidden","addEventListener","isTicking","timestamp","deltaTime","defaultSpeed","defaultEasing","defaultDuration","lastProgress","lastComplete","flags","_ready","_started","_first","delta","activeEasing","millisecondsEllapsed","mock","reverse","currentValue","easingComplete","best","j","tweenFrom","tweenTo","tweenPercent","result","startsWith","asyncCallbacks","tick","defaultQueue","endValues","promiseHandler","finishAll","isVelocityResult","animations","then","finish","animationFlags","isReady","isStarted","isPaused","isSync","isReverse","action","key","flag","isPercentComplete","option","pauseResume","SyntaxError","stop","isPlainObject","_rejecter","join","styleAction","requireForcefeeding","Error","fakeAnimation","singleResult","maybeSequence","SequencesObject","propertyTween","tweenEasing","tweenAction","colorValues","color","amount","pow","registerBackIn","registerBackOut","registerBackInOut","easeOutBouncePercent","easeInBouncePercent","easeInBounce","easeOutBounce","easeInOutBounce","PI2","amplitude","period","sin","asin","s","registerElasticIn","registerElasticOut","registerElasticInOut","atStart","during","atEnd","getDimension","inlineRx","listItemRx","tableRowRx","tableRx","tableRowGroupRx","computePropertyValue","nodeName","display","clientWidth","scrollWidth","clientHeight","scrollHeight","direction","client","scrollValue","scroll","rxAddPx","unprefixed","rxVendors","prefixElement","addUnit","getSetPrefixed","getSetStyle","getAttribute","setAttribute","base","rxSubtype","rxElement","getOwnPropertyNames","forEach","subtype","exec","createElementNS","attribute","getBBox","getSetTween","VERSION","VelocityFn","VelocityStatic","ActionsObject","EasingsObject","StateObject","DefaultObject","patchFn","IE","documentMode","div","innerHTML","getElementsByTagName","jQuery","Zepto","NodeList","HTMLCollection","rxPercents","percents","percentages","keys","orderedPercents","sort","a1","b1","stepProperties","realSequence","originalProperty","sequenceList","registerSequence","argsList","args0","p","names","isWrapped","syntacticSugar","bind","argumentIndex","propertiesMap","isAction","opts","o","Promise","optionsMap","resolve","reject","catch","finally","actionArgs","rejecter","hasValidDuration","validDuration","isGingerbread","visibility","optionsBegin","optionsComplete","optionsProgress","validateProgress","optionsSync","offset","rootAnimation","lastAnimation","global"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;;;AAGA,mBA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AAV;gBAEIuT,SAAJ,UAAqB,IAArB,eAAmC7b,CAAnC;gBACI4b,IAAIE,oBAAJ,CAAyB,MAAzB,EAAiCphB,MAArC,EAA6C;sBACtC,IAAN;uBAEOsF,CAAP;;;;WAKI9D,SAAP;CApBU,EAAX;;;;AA2BA,IAAIwf,QAAM,CAAV,EAAa;UACN,IAAI7E,KAAJ,CAAU,yDAAV,CAAN;;;;;AAOD,IAAIhc,MAAJ,EAAY;;;;;;;;;;;QAWLkhB,WAAqBlhB,OAAekhB,MAA1C;QACCC,UAAoBnhB,OAAemhB,KADpC;UAGQnhB,MAAR,EAAgB,IAAhB;UACQQ,WAAWA,QAAQpB,SAA3B;UACQgiB,YAAYA,SAAShiB,SAA7B;UACQiiB,kBAAkBA,eAAejiB,SAAzC;UAEQ8hB,QAAR,EAAgB,IAAhB;UACQA,YAAUA,SAAO5X,EAAzB;UAEQ6X,OAAR,EAAe,IAAf;UACQA,WAASA,QAAM7X,EAAvB;;;;6BAIUlJ;QACNmgB,iBAAe7gB,cAAf,CAA8BU,QAA9B,CAAJ,EAA6C;uBAC7BA,QAAf,yCAAeA,QAAf;iBACM,QAAL;iBACK,SAAL;iCACgBqQ,UAAf,EAAyBrQ,QAAzB,EAAmC;uBAAA;+BAE1BmgB,iBAAengB,QAAf,CAAP;qBAFiC;uBAAA,kBAI9BW,KAJ8B;yCAKlBX,QAAf,IAA2BW,KAA3B;;iBALF,EAOG,IAPH;;;iCAWe0P,UAAf,EAAyBrQ,QAAzB,EAAmCmgB,iBAAengB,QAAf,CAAnC,EAA6D,IAA7D;;;;;;AAhBJ,KAAK,IAAMA,UAAX,IAAuBmgB,gBAAvB,EAAuC;YAA5BngB,UAA4B;;;"} \ No newline at end of file diff --git a/velocity.js b/velocity.js index 092be28a..cc12e22c 100644 --- a/velocity.js +++ b/velocity.js @@ -1456,6 +1456,7 @@ } } } + //# sourceMappingURL=setPropertyValue.js.map /** * Cache every camelCase match to avoid repeating lookups. @@ -4298,21 +4299,18 @@ // Due to being an async call, they should be back to "normal" // before the .then() function gets called. resolver = function resolver(result) { - if (isVelocityResult(result)) { - var then = result && result.then; - if (then) { - result.then = undefined; // Preserving enumeration etc - } + if (isVelocityResult(result) && result.then) { + var then = result.then; + result.then = undefined; // Preserving enumeration etc resolve(result); - if (then) { - result.then = then; - } + result.then = then; } else { resolve(result); } }; }); if (elements) { + defineProperty$1(elements, "promise", promise); defineProperty$1(elements, "then", promise.then.bind(promise)); defineProperty$1(elements, "catch", promise.catch.bind(promise)); if (promise.finally) { @@ -4554,7 +4552,6 @@ /* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */ return elements || promise; } - //# sourceMappingURL=velocityFn.js.map // Project /** diff --git a/velocity.js.map b/velocity.js.map index f119b14d..b9fadd1c 100644 --- a/velocity.js.map +++ b/velocity.js.map @@ -1 +1 @@ -{"version":3,"file":"velocity.js","sources":["src/types.ts","src/utility.ts","src/Velocity/actions/actions.ts","src/constants.ts","src/Velocity/easing/easings.ts","src/Velocity/easing/bezier.ts","src/Velocity/easing/spring_rk4.ts","src/Velocity/easing/step.ts","src/Velocity/options.ts","src/Velocity/defaults.ts","src/Velocity/normalizations/normalizationsObject.ts","src/Velocity/data.ts","src/Velocity/state.ts","src/Velocity/queue.ts","src/Velocity/complete.ts","src/Velocity/normalizations/normalizations.ts","src/Velocity/css/setPropertyValue.ts","src/Velocity/camelCase.ts","src/Velocity/css/fixColors.ts","src/Velocity/css/augmentDimension.ts","src/Velocity/css/getPropertyValue.ts","src/Velocity/tweens.ts","src/Velocity/tick.ts","src/Velocity/actions/finish.ts","src/Velocity/actions/option.ts","src/Velocity/actions/pauseResume.ts","src/Velocity/actions/reverse.ts","src/Velocity/actions/stop.ts","src/Velocity/actions/style.ts","src/Velocity/actions/tween.ts","src/Velocity/css/colors.ts","src/Velocity/easing/back.ts","src/Velocity/easing/bounce.ts","src/Velocity/easing/elastic.ts","src/Velocity/easing/string.ts","src/Velocity/normalizations/dimensions.ts","src/Velocity/normalizations/display.ts","src/Velocity/normalizations/scroll.ts","src/Velocity/normalizations/style.ts","src/Velocity/normalizations/svg/attributes.ts","src/Velocity/normalizations/svg/dimensions.ts","src/Velocity/normalizations/tween.ts","version.ts","src/velocity.ts","src/Velocity/sequences.ts","src/velocityFn.ts","src/Velocity/patch.ts","src/velocity.ts"],"sourcesContent":["/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Runtime type checking methods.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityResult} from \"./../velocity.d\";\r\n\r\n/**\r\n * Check if a variable is a boolean.\r\n */\r\nexport function isBoolean(variable: any): variable is boolean {\r\n\treturn variable === true || variable === false;\r\n}\r\n\r\n/**\r\n * Check if a variable is an empty object.\r\n */\r\nexport function isEmptyObject(variable: {}): variable is {} {\r\n\tfor (const name in variable) {\r\n\t\tif (variable.hasOwnProperty(name)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Check if a variable is a function.\r\n */\r\nexport function isFunction(variable: any): variable is Function { // tslint:disable-line:ban-types\r\n\treturn Object.prototype.toString.call(variable) === \"[object Function]\";\r\n}\r\n\r\n/**\r\n * Check if a variable is an HTMLElement or SVGElement.\r\n */\r\nexport function isNode(variable: any): variable is HTMLorSVGElement {\r\n\treturn !!(variable && (variable as Element).nodeType);\r\n}\r\n\r\n/**\r\n * Check if a variable is a number.\r\n */\r\nexport function isNumber(variable: any): variable is number {\r\n\treturn typeof variable === \"number\";\r\n}\r\n\r\n/**\r\n * Faster way to parse a string/number as a number https://jsperf.com/number-vs-parseint-vs-plus/3\r\n */\r\nexport function isNumberWhenParsed(variable: any): variable is number {\r\n\treturn !isNaN(Number(variable));\r\n}\r\n\r\n/**\r\n * Check if a variable is a plain object (and not an instance).\r\n */\r\nexport function isPlainObject(variable: any): variable is {} {\r\n\tif (!variable || typeof variable !== \"object\" || (variable as Element).nodeType || Object.prototype.toString.call(variable) !== \"[object Object]\") {\r\n\t\treturn false;\r\n\t}\r\n\tconst proto = Object.getPrototypeOf(variable) as object;\r\n\r\n\treturn !proto || (proto.hasOwnProperty(\"constructor\") && proto.constructor === Object);\r\n}\r\n\r\n/**\r\n * Check if a variable is an SVGElement.\r\n */\r\nexport function isSVG(variable: any): variable is SVGElement {\r\n\treturn SVGElement && variable instanceof SVGElement;\r\n}\r\n\r\n/**\r\n * Check if a variable is a string.\r\n */\r\nexport function isString(variable: any): variable is string {\r\n\treturn typeof variable === \"string\";\r\n}\r\n\r\n/**\r\n * Check if a variable is the result of calling Velocity.\r\n */\r\nexport function isVelocityResult(variable: any): variable is VelocityResult {\r\n\treturn variable && isNumber((variable as VelocityResult).length) && isFunction((variable as VelocityResult).velocity);\r\n}\r\n\r\n/**\r\n * Check if a variable is an array-like wrapped jQuery, Zepto or similar, where\r\n * each indexed value is a Node.\r\n */\r\n\r\nexport function isWrapped(variable: any): variable is HTMLorSVGElement[] {\r\n\treturn variable\r\n\t\t&& variable !== window\r\n\t\t&& isNumber((variable as HTMLorSVGElement[]).length)\r\n\t\t&& !isString(variable)\r\n\t\t&& !isFunction(variable)\r\n\t\t&& !isNode(variable)\r\n\t\t&& ((variable as HTMLorSVGElement[]).length === 0 || isNode(variable[0]));\r\n}\r\n\r\n/**\r\n * Check is a property is an enumerable member of an object.\r\n */\r\nexport function propertyIsEnumerable(obj: object, property: string): boolean {\r\n\treturn Object.prototype.propertyIsEnumerable.call(obj, property);\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isNode} from \"./types\";\r\n\r\n/**\r\n * Add a single className to an Element.\r\n */\r\nexport function addClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.add(className);\r\n\t\t} else {\r\n\t\t\tremoveClass(element, className);\r\n\t\t\t(element as any).className += (element.className.length ? \" \" : \"\") + className;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Clone an array, works for array-like too.\r\n */\r\nexport function cloneArray(arrayLike: T[] | ArrayLike): T[] {\r\n\treturn Array.prototype.slice.call(arrayLike, 0);\r\n}\r\n\r\n/**\r\n * The defineProperty() function provides a\r\n * shortcut to defining a property that cannot be accidentally iterated across.\r\n */\r\nexport function defineProperty(proto: any, name: string, value: any, readonly?: boolean) {\r\n\tif (proto) {\r\n\t\tObject.defineProperty(proto, name, {\r\n\t\t\tconfigurable: !readonly,\r\n\t\t\twritable: !readonly,\r\n\t\t\tvalue,\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * When there are multiple locations for a value pass them all in, then get the\r\n * first value that is valid.\r\n */\r\nexport function getValue(...args: T[]): T {\r\n\tfor (const arg of arguments) {\r\n\t\tif (arg !== undefined && arg === arg) {\r\n\t\t\treturn arg;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Shim to get the current milliseconds - on anything except old IE it'll use\r\n * Date.now() and save creating an object. If that doesn't exist then it'll\r\n * create one that gets GC.\r\n */\r\nexport const now = Date.now ? Date.now : () => {\r\n\treturn (new Date()).getTime();\r\n};\r\n\r\n/**\r\n * Remove a single className from an Element.\r\n */\r\nexport function removeClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.remove(className);\r\n\t\t} else {\r\n\t\t\t// TODO: Need some jsperf tests on performance - can we get rid of the regex and maybe use split / array manipulation?\r\n\t\t\t(element as any).className = element.className.replace(new RegExp(`(^|\\\\s)${className}(\\\\s|$)`, \"gi\"), \" \");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Convert an element or array-like element list into an array if needed.\r\n */\r\nexport function sanitizeElements(elements: HTMLorSVGElement | HTMLorSVGElement[]): HTMLorSVGElement[] {\r\n\treturn isNode(elements)\r\n\t\t? [elements] as HTMLorSVGElement[]\r\n\t\t: elements as HTMLorSVGElement[];\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityActionFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString, propertyIsEnumerable} from \"../../types\";\r\nimport {defineProperty} from \"../../utility\";\r\n\r\n// Constants\r\nexport const Actions: {[name: string]: VelocityActionFn} = {};\r\n\r\n/**\r\n * Used to register an action. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerAction\", \"name\", VelocityActionFn);\r\n */\r\nexport function registerAction(args?: [string, VelocityActionFn], internal?: boolean) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' callback to an invalid value:`, name, callback);\r\n\t} else if (Actions[name] && !propertyIsEnumerable(Actions, name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override internal 'registerAction' callback`, name);\r\n\t} else if (internal === true) {\r\n\t\tdefineProperty(Actions, name, callback);\r\n\t} else {\r\n\t\tActions[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerAction\", registerAction as any], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Constants and defaults. These values should never change without a MINOR\r\n * version bump.\r\n */\r\n\r\n/**\r\n * Without this it will only un-prefix properties that have a valid \"normal\"\r\n * version.\r\n */\r\nexport const ALL_VENDOR_PREFIXES = true;\r\n\r\nexport const DURATION_FAST = 200;\r\nexport const DURATION_NORMAL = 400;\r\nexport const DURATION_SLOW = 600;\r\n\r\nexport const FUZZY_MS_PER_SECOND = 980;\r\n\r\nexport const DEFAULT_CACHE = true;\r\nexport const DEFAULT_DELAY = 0;\r\nexport const DEFAULT_DURATION = DURATION_NORMAL;\r\nexport const DEFAULT_EASING = \"swing\";\r\nexport const DEFAULT_FPSLIMIT = 60;\r\nexport const DEFAULT_LOOP = 0;\r\nexport const DEFAULT_PROMISE = true;\r\nexport const DEFAULT_PROMISE_REJECT_EMPTY = true;\r\nexport const DEFAULT_QUEUE = \"\";\r\nexport const DEFAULT_REPEAT = 0;\r\nexport const DEFAULT_SPEED = 1;\r\nexport const DEFAULT_SYNC = true;\r\n\r\nexport const CLASSNAME = \"velocity-animating\";\r\n\r\nexport const Duration = {\r\n\tfast: DURATION_FAST,\r\n\tnormal: DURATION_NORMAL,\r\n\tslow: DURATION_SLOW,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\n\r\n// Constants\r\nexport const Easings: {[name: string]: VelocityEasingFn} = {};\r\n\r\n/**\r\n * Used to register a easing. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerEasing\", \"name\", VelocityEasingFn);\r\n */\r\nexport function registerEasing(args?: [string, VelocityEasingFn]) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' callback to an invalid value:`, name, callback);\r\n\t} else if (Easings[name]) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override 'registerEasing' callback`, name);\r\n\t} else {\r\n\t\tEasings[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerEasing\", registerEasing], true);\r\n\r\n/**\r\n * Linear easing, used for sequence parts that don't have an actual easing\r\n * function.\r\n */\r\nexport function linearEasing(percentComplete, startValue, endValue, property) {\r\n\treturn startValue + percentComplete * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * Swing is the default for jQuery and Velocity.\r\n */\r\nexport function swingEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (0.5 - Math.cos(percentComplete * Math.PI) / 2) * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * A less exaggerated version of easeInOutElastic.\r\n */\r\nexport function springEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (1 - (Math.cos(percentComplete * 4.5 * Math.PI) * Math.exp(-percentComplete * 6))) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"linear\", linearEasing]);\r\nregisterEasing([\"swing\", swingEasing]);\r\nregisterEasing([\"spring\", springEasing]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Fix to a range of 0 <= num <= 1.\r\n */\r\nfunction fixRange(num: number) {\r\n\treturn Math.min(Math.max(num, 0), 1);\r\n}\r\n\r\nfunction A(aA1, aA2) {\r\n\treturn 1 - 3 * aA2 + 3 * aA1;\r\n}\r\n\r\nfunction B(aA1, aA2) {\r\n\treturn 3 * aA2 - 6 * aA1;\r\n}\r\n\r\nfunction C(aA1) {\r\n\treturn 3 * aA1;\r\n}\r\n\r\nfunction calcBezier(aT, aA1, aA2) {\r\n\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\r\n}\r\n\r\nfunction getSlope(aT, aA1, aA2) {\r\n\treturn 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);\r\n}\r\n\r\nexport function generateBezier(mX1: number, mY1: number, mX2: number, mY2: number): VelocityEasingFn {\r\n\tconst NEWTON_ITERATIONS = 4,\r\n\t\tNEWTON_MIN_SLOPE = 0.001,\r\n\t\tSUBDIVISION_PRECISION = 0.0000001,\r\n\t\tSUBDIVISION_MAX_ITERATIONS = 10,\r\n\t\tkSplineTableSize = 11,\r\n\t\tkSampleStepSize = 1 / (kSplineTableSize - 1),\r\n\t\tfloat32ArraySupported = \"Float32Array\" in window;\r\n\r\n\t/* Must contain four arguments. */\r\n\tif (arguments.length !== 4) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/* Arguments must be numbers. */\r\n\tfor (let i = 0; i < 4; ++i) {\r\n\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\t/* X values must be in the [0, 1] range. */\r\n\tmX1 = fixRange(mX1);\r\n\tmX2 = fixRange(mX2);\r\n\r\n\tconst mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n\r\n\tfunction newtonRaphsonIterate(aX, aGuessT) {\r\n\t\tfor (let i = 0; i < NEWTON_ITERATIONS; ++i) {\r\n\t\t\tconst currentSlope = getSlope(aGuessT, mX1, mX2);\r\n\r\n\t\t\tif (currentSlope === 0) {\r\n\t\t\t\treturn aGuessT;\r\n\t\t\t}\r\n\r\n\t\t\tconst currentX = calcBezier(aGuessT, mX1, mX2) - aX;\r\n\t\t\taGuessT -= currentX / currentSlope;\r\n\t\t}\r\n\r\n\t\treturn aGuessT;\r\n\t}\r\n\r\n\tfunction calcSampleValues() {\r\n\t\tfor (let i = 0; i < kSplineTableSize; ++i) {\r\n\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction binarySubdivide(aX, aA, aB) {\r\n\t\tlet currentX, currentT, i = 0;\r\n\r\n\t\tdo {\r\n\t\t\tcurrentT = aA + (aB - aA) / 2;\r\n\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\r\n\t\t\tif (currentX > 0) {\r\n\t\t\t\taB = currentT;\r\n\t\t\t} else {\r\n\t\t\t\taA = currentT;\r\n\t\t\t}\r\n\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\r\n\r\n\t\treturn currentT;\r\n\t}\r\n\r\n\tfunction getTForX(aX) {\r\n\t\tconst lastSample = kSplineTableSize - 1;\r\n\t\tlet intervalStart = 0,\r\n\t\t\tcurrentSample = 1;\r\n\r\n\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\r\n\t\t\tintervalStart += kSampleStepSize;\r\n\t\t}\r\n\r\n\t\t--currentSample;\r\n\r\n\t\tconst dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\r\n\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\r\n\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\r\n\r\n\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\r\n\t\t\treturn newtonRaphsonIterate(aX, guessForT);\r\n\t\t} else if (initialSlope === 0) {\r\n\t\t\treturn guessForT;\r\n\t\t} else {\r\n\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\r\n\t\t}\r\n\t}\r\n\r\n\tlet precomputed = false;\r\n\r\n\tfunction precompute() {\r\n\t\tprecomputed = true;\r\n\t\tif (mX1 !== mY1 || mX2 !== mY2) {\r\n\t\t\tcalcSampleValues();\r\n\t\t}\r\n\t}\r\n\r\n\tconst str = `generateBezier(${[mX1, mY1, mX2, mY2]})`,\r\n\t\tf = (percentComplete: number, startValue: number, endValue: number, property?: string) => {\r\n\t\t\tif (!precomputed) {\r\n\t\t\t\tprecompute();\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 0) {\r\n\t\t\t\treturn startValue;\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 1) {\r\n\t\t\t\treturn endValue;\r\n\t\t\t}\r\n\t\t\tif (mX1 === mY1 && mX2 === mY2) {\r\n\t\t\t\treturn startValue + percentComplete * (endValue - startValue);\r\n\t\t\t}\r\n\r\n\t\t\treturn startValue + calcBezier(getTForX(percentComplete), mY1, mY2) * (endValue - startValue);\r\n\t\t};\r\n\r\n\t(f as any).getControlPoints = () => {\r\n\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\r\n\t};\r\n\tf.toString = () => {\r\n\t\treturn str;\r\n\t};\r\n\r\n\treturn f;\r\n}\r\n\r\n/* Common easings */\r\nconst easeIn = generateBezier(0.42, 0, 1, 1),\r\n\teaseOut = generateBezier(0, 0, 0.58, 1),\r\n\teaseInOut = generateBezier(0.42, 0, 0.58, 1);\r\n\r\nregisterEasing([\"ease\", generateBezier(0.25, 0.1, 0.25, 1)]);\r\nregisterEasing([\"easeIn\", easeIn]);\r\nregisterEasing([\"ease-in\", easeIn]);\r\nregisterEasing([\"easeOut\", easeOut]);\r\nregisterEasing([\"ease-out\", easeOut]);\r\nregisterEasing([\"easeInOut\", easeInOut]);\r\nregisterEasing([\"ease-in-out\", easeInOut]);\r\nregisterEasing([\"easeInSine\", generateBezier(0.47, 0, 0.745, 0.715)]);\r\nregisterEasing([\"easeOutSine\", generateBezier(0.39, 0.575, 0.565, 1)]);\r\nregisterEasing([\"easeInOutSine\", generateBezier(0.445, 0.05, 0.55, 0.95)]);\r\nregisterEasing([\"easeInQuad\", generateBezier(0.55, 0.085, 0.68, 0.53)]);\r\nregisterEasing([\"easeOutQuad\", generateBezier(0.25, 0.46, 0.45, 0.94)]);\r\nregisterEasing([\"easeInOutQuad\", generateBezier(0.455, 0.03, 0.515, 0.955)]);\r\nregisterEasing([\"easeInCubic\", generateBezier(0.55, 0.055, 0.675, 0.19)]);\r\nregisterEasing([\"easeOutCubic\", generateBezier(0.215, 0.61, 0.355, 1)]);\r\nregisterEasing([\"easeInOutCubic\", generateBezier(0.645, 0.045, 0.355, 1)]);\r\nregisterEasing([\"easeInQuart\", generateBezier(0.895, 0.03, 0.685, 0.22)]);\r\nregisterEasing([\"easeOutQuart\", generateBezier(0.165, 0.84, 0.44, 1)]);\r\nregisterEasing([\"easeInOutQuart\", generateBezier(0.77, 0, 0.175, 1)]);\r\nregisterEasing([\"easeInQuint\", generateBezier(0.755, 0.05, 0.855, 0.06)]);\r\nregisterEasing([\"easeOutQuint\", generateBezier(0.23, 1, 0.32, 1)]);\r\nregisterEasing([\"easeInOutQuint\", generateBezier(0.86, 0, 0.07, 1)]);\r\nregisterEasing([\"easeInExpo\", generateBezier(0.95, 0.05, 0.795, 0.035)]);\r\nregisterEasing([\"easeOutExpo\", generateBezier(0.19, 1, 0.22, 1)]);\r\nregisterEasing([\"easeInOutExpo\", generateBezier(1, 0, 0, 1)]);\r\nregisterEasing([\"easeInCirc\", generateBezier(0.6, 0.04, 0.98, 0.335)]);\r\nregisterEasing([\"easeOutCirc\", generateBezier(0.075, 0.82, 0.165, 1)]);\r\nregisterEasing([\"easeInOutCirc\", generateBezier(0.785, 0.135, 0.15, 0.86)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\ninterface springState {\r\n\tx: number;\r\n\tv: number;\r\n\ttension: number;\r\n\tfriction: number;\r\n}\r\n\r\ninterface springDelta {\r\n\tdx: number;\r\n\tdv: number;\r\n}\r\n\r\n/* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\r\n/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass\r\n then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\r\nfunction springAccelerationForState(state: springState) {\r\n\treturn (-state.tension * state.x) - (state.friction * state.v);\r\n}\r\n\r\nfunction springEvaluateStateWithDerivative(initialState: springState, dt: number, derivative: springDelta): springDelta {\r\n\tconst state = {\r\n\t\tx: initialState.x + derivative.dx * dt,\r\n\t\tv: initialState.v + derivative.dv * dt,\r\n\t\ttension: initialState.tension,\r\n\t\tfriction: initialState.friction,\r\n\t};\r\n\r\n\treturn {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t};\r\n}\r\n\r\nfunction springIntegrateState(state: springState, dt: number) {\r\n\tconst a = {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t},\r\n\t\tb = springEvaluateStateWithDerivative(state, dt * 0.5, a),\r\n\t\tc = springEvaluateStateWithDerivative(state, dt * 0.5, b),\r\n\t\td = springEvaluateStateWithDerivative(state, dt, c),\r\n\t\tdxdt = 1 / 6 * (a.dx + 2 * (b.dx + c.dx) + d.dx),\r\n\t\tdvdt = 1 / 6 * (a.dv + 2 * (b.dv + c.dv) + d.dv);\r\n\r\n\tstate.x = state.x + dxdt * dt;\r\n\tstate.v = state.v + dvdt * dt;\r\n\r\n\treturn state;\r\n}\r\n\r\nexport function generateSpringRK4(tension: number, friction: number): number;\r\nexport function generateSpringRK4(tension: number, friction: number, duration: number): VelocityEasingFn;\r\nexport function generateSpringRK4(tension: number, friction: number, duration?: number): any {\r\n\tconst initState: springState = {\r\n\t\tx: -1,\r\n\t\tv: 0,\r\n\t\ttension: parseFloat(tension as any) || 500,\r\n\t\tfriction: parseFloat(friction as any) || 20,\r\n\t},\r\n\t\tpath = [0],\r\n\t\ttolerance = 1 / 10000,\r\n\t\tDT = 16 / 1000,\r\n\t\thaveDuration = duration != null; // deliberate \"==\", as undefined == null != 0\r\n\tlet timeLapsed = 0,\r\n\t\tdt: number,\r\n\t\tlastState: springState;\r\n\r\n\t/* Calculate the actual time it takes for this animation to complete with the provided conditions. */\r\n\tif (haveDuration) {\r\n\t\t/* Run the simulation without a duration. */\r\n\t\ttimeLapsed = generateSpringRK4(initState.tension, initState.friction);\r\n\t\t/* Compute the adjusted time delta. */\r\n\t\tdt = (timeLapsed as number) / duration * DT;\r\n\t} else {\r\n\t\tdt = DT;\r\n\t}\r\n\r\n\twhile (true) {\r\n\t\t/* Next/step function .*/\r\n\t\tlastState = springIntegrateState(lastState || initState, dt);\r\n\t\t/* Store the position. */\r\n\t\tpath.push(1 + lastState.x);\r\n\t\ttimeLapsed += 16;\r\n\t\t/* If the change threshold is reached, break. */\r\n\t\tif (!(Math.abs(lastState.x) > tolerance && Math.abs(lastState.v) > tolerance)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\r\n\t computed path and returns a snapshot of the position according to a given percentComplete. */\r\n\treturn !haveDuration ? timeLapsed : (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + path[Math.floor(percentComplete * (path.length - 1))] * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details\r\n *\r\n * Step easing generator.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Constants\r\nconst cache: {[steps: number]: VelocityEasingFn} = {};\r\n\r\nexport function generateStep(steps): VelocityEasingFn {\r\n\tconst fn = cache[steps];\r\n\r\n\tif (fn) {\r\n\t\treturn fn;\r\n\t}\r\n\r\n\treturn cache[steps] = (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + Math.round(percentComplete * steps) * (1 / steps) * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Validation functions used for various types of data that can be supplied.\r\n * All errors are reported in the non-minified version for development. If a\r\n * validation fails then it should return undefined.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityCallback, VelocityEasingFn, VelocityEasingType, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {Duration} from \"../constants\";\r\nimport {isBoolean, isFunction, isNumber, isString} from \"../types\";\r\nimport {generateBezier} from \"./easing/bezier\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {generateSpringRK4} from \"./easing/spring_rk4\";\r\nimport {generateStep} from \"./easing/step\";\r\n\r\n/**\r\n * Parse a duration value and return an ms number. Optionally return a\r\n * default value if the number is not valid.\r\n */\r\nexport function parseDuration(duration: \"fast\" | \"normal\" | \"slow\" | number, def?: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tif (isNumber(duration)) {\r\n\t\treturn duration;\r\n\t}\r\n\tif (isString(duration)) {\r\n\t\treturn Duration[duration.toLowerCase()]\r\n\t\t\t|| parseFloat(duration.replace(\"ms\", \"\")\r\n\t\t\t\t.replace(\"s\", \"000\"));\r\n\t}\r\n\r\n\treturn def == null ? undefined : parseDuration(def);\r\n}\r\n\r\n/**\r\n * Validate a cache option.\r\n */\r\nexport function validateCache(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'cache' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a begin option.\r\n */\r\nexport function validateBegin(value: VelocityCallback): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'begin' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a complete option.\r\n */\r\nexport function validateComplete(value: VelocityCallback, noError?: true): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'complete' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a delay option.\r\n */\r\nexport function validateDelay(value: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed)) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'delay' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a duration option.\r\n */\r\nexport function validateDuration(value: \"fast\" | \"normal\" | \"slow\" | number, noError?: true): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'duration' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a easing option.\r\n */\r\nexport function validateEasing(value: VelocityEasingType, duration: number, noError?: true): VelocityEasingFn {\r\n\tif (isString(value)) {\r\n\t\t// Named easing\r\n\t\treturn Easings[value];\r\n\t}\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\t// TODO: We should only do these if the correct function exists - don't force loading.\r\n\tif (Array.isArray(value)) {\r\n\t\tif (value.length === 1) {\r\n\t\t\t// Steps\r\n\t\t\treturn generateStep(value[0]);\r\n\t\t}\r\n\t\tif (value.length === 2) {\r\n\t\t\t// springRK4 must be passed the animation's duration.\r\n\t\t\t// Note: If the springRK4 array contains non-numbers,\r\n\t\t\t// generateSpringRK4() returns an easing function generated with\r\n\t\t\t// default tension and friction values.\r\n\t\t\treturn generateSpringRK4(value[0], value[1], duration);\r\n\t\t}\r\n\t\tif (value.length === 4) {\r\n\t\t\t// Note: If the bezier array contains non-numbers, generateBezier()\r\n\t\t\t// returns undefined.\r\n\t\t\treturn generateBezier.apply(null, value) || false;\r\n\t\t}\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'easing' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a fpsLimit option.\r\n */\r\nexport function validateFpsLimit(value: number | false): number {\r\n\tif (value === false) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\treturn Math.min(parsed, 60);\r\n\t\t}\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'fpsLimit' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a loop option.\r\n */\r\nexport function validateLoop(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'loop' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a progress option.\r\n */\r\nexport function validateProgress(value: VelocityProgress): VelocityProgress {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'progress' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promise option.\r\n */\r\nexport function validatePromise(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promise' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promiseRejectEmpty option.\r\n */\r\nexport function validatePromiseRejectEmpty(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promiseRejectEmpty' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a queue option.\r\n */\r\nexport function validateQueue(value: string | false, noError?: true): string | false {\r\n\tif (value === false || isString(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'queue' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a repeat option.\r\n */\r\nexport function validateRepeat(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'repeat' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a speed option.\r\n */\r\nexport function validateSpeed(value: number): number {\r\n\tif (isNumber(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'speed' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a sync option.\r\n */\r\nexport function validateSync(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'sync' to an invalid value:`, value);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Velocity option defaults, which can be overriden by the user.\r\n */\r\n\r\n// Typedefs\r\nimport {StrictVelocityOptions, VelocityCallback, VelocityEasingType} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean} from \"../types\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateEasing, validateFpsLimit, validateLoop, validatePromise, validatePromiseRejectEmpty,\r\n\tvalidateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./options\";\r\n\r\n// Constants\r\nimport {\r\n\tDEFAULT_CACHE, DEFAULT_DELAY, DEFAULT_DURATION, DEFAULT_EASING, DEFAULT_FPSLIMIT,\r\n\tDEFAULT_LOOP, DEFAULT_PROMISE, DEFAULT_PROMISE_REJECT_EMPTY, DEFAULT_QUEUE, DEFAULT_REPEAT,\r\n\tDEFAULT_SPEED, DEFAULT_SYNC, FUZZY_MS_PER_SECOND,\r\n} from \"../constants\";\r\n\r\nexport const defaults: StrictVelocityOptions & {reset?: () => void} = {\r\n\tmobileHA: true,\r\n};\r\n\r\n// NOTE: Add the variable here, then add the default state in \"reset\" below.\r\nlet cache: boolean,\r\n\tbegin: VelocityCallback,\r\n\tcomplete: VelocityCallback,\r\n\tdelay: number,\r\n\tduration: number,\r\n\teasing: VelocityEasingType,\r\n\tfpsLimit: number,\r\n\tloop: number | true,\r\n\tmobileHA: boolean,\r\n\tminFrameTime: number,\r\n\tpromise: boolean,\r\n\tpromiseRejectEmpty: boolean,\r\n\tqueue: string | false,\r\n\trepeat: number | true,\r\n\tspeed: number,\r\n\tsync: boolean;\r\n\r\n// IMPORTANT: Make sure any new defaults get added to the actions/set.ts list\r\nObject.defineProperties(defaults, {\r\n\treset: {\r\n\t\tenumerable: true,\r\n\t\tvalue() {\r\n\t\t\tcache = DEFAULT_CACHE;\r\n\t\t\tbegin = undefined;\r\n\t\t\tcomplete = undefined;\r\n\t\t\tdelay = DEFAULT_DELAY;\r\n\t\t\tduration = DEFAULT_DURATION;\r\n\t\t\teasing = validateEasing(DEFAULT_EASING, DEFAULT_DURATION);\r\n\t\t\tfpsLimit = DEFAULT_FPSLIMIT;\r\n\t\t\tloop = DEFAULT_LOOP;\r\n\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / DEFAULT_FPSLIMIT;\r\n\t\t\tpromise = DEFAULT_PROMISE;\r\n\t\t\tpromiseRejectEmpty = DEFAULT_PROMISE_REJECT_EMPTY;\r\n\t\t\tqueue = DEFAULT_QUEUE;\r\n\t\t\trepeat = DEFAULT_REPEAT;\r\n\t\t\tspeed = DEFAULT_SPEED;\r\n\t\t\tsync = DEFAULT_SYNC;\r\n\t\t},\r\n\t},\r\n\tcache: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn cache;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcache = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tbegin: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn begin;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tbegin = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tcomplete: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn complete;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcomplete = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tdelay: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn delay;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tdelay = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tduration: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn duration;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tduration = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\teasing: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityEasingType {\r\n\t\t\treturn easing;\r\n\t\t},\r\n\t\tset(value: VelocityEasingType) {\r\n\t\t\tvalue = validateEasing(value, duration);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\teasing = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tfpsLimit: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn fpsLimit;\r\n\t\t},\r\n\t\tset(value: number | false) {\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tfpsLimit = value;\r\n\t\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tloop: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn loop;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tloop = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tmobileHA: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn mobileHA;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tif (isBoolean(value)) {\r\n\t\t\t\tmobileHA = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tminFrameTime: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn minFrameTime;\r\n\t\t},\r\n\t},\r\n\tpromise: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promise;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromise(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromise = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tpromiseRejectEmpty: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promiseRejectEmpty;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromiseRejectEmpty(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromiseRejectEmpty = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tqueue: {\r\n\t\tenumerable: true,\r\n\t\tget(): string | false {\r\n\t\t\treturn queue;\r\n\t\t},\r\n\t\tset(value: string | false) {\r\n\t\t\tvalue = validateQueue(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tqueue = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\trepeat: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn repeat;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\trepeat = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tspeed: {\r\n\t\tenumerable: true,\r\n\t\tget(): number {\r\n\t\t\treturn speed;\r\n\t\t},\r\n\t\tset(value: number) {\r\n\t\t\tvalue = validateSpeed(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tspeed = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tsync: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn sync;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateSync(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tsync = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n});\r\n\r\n// Reset to our default values, currently everything is undefined.\r\ndefaults.reset();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n/**\r\n * The highest type index for finding the best normalization for a property.\r\n */\r\nexport let MaxType: number = -1;\r\n\r\n/**\r\n * Unlike \"actions\", normalizations can always be replaced by users.\r\n */\r\nexport const Normalizations: {[name: string]: VelocityNormalizationsFn}[] = [];\r\n\r\n/**\r\n * Store a cross-reference to units to be added to specific normalization\r\n * functions if the user supplies a unit-less number.\r\n *\r\n * This is pretty much confined to adding \"px\" to several css properties.\r\n */\r\nexport const NormalizationUnits: {[unit: string]: VelocityNormalizationsFn[]} = {};\r\n\r\n/**\r\n * Any normalisations that should never be cached are listed here.\r\n * Faster than an array - https://jsperf.com/array-includes-and-find-methods-vs-set-has\r\n */\r\nexport const NoCacheNormalizations = new Set();\r\n\r\n/**\r\n * Used to define a constructor.\r\n */\r\nexport interface ClassConstructor {\r\n\tnew(): object;\r\n}\r\n\r\n/**\r\n * An array of classes used for the per-class normalizations. This\r\n * translates into a bitwise enum for quick cross-reference, and so that\r\n * the element doesn't need multiple instanceof calls every\r\n * frame.\r\n */\r\nexport const constructors: (ClassConstructor | string)[] = [];\r\n\r\n/**\r\n * A cache of the various constructors we've found and mapping to their real\r\n * name - saves expensive lookups.\r\n */\r\nexport const constructorCache = new Map();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {ElementData, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {constructors} from \"./normalizations/normalizationsObject\";\r\n\r\n// Constants\r\nconst dataName = \"velocityData\";\r\n\r\n/**\r\n * Get (and create) the internal data store for an element.\r\n */\r\nexport function Data(element: HTMLorSVGElement): ElementData {\r\n\t// Use a string member so Uglify doesn't mangle it.\r\n\tconst data = element[dataName];\r\n\r\n\tif (data) {\r\n\t\treturn data;\r\n\t}\r\n\tconst window = element.ownerDocument.defaultView;\r\n\tlet types = 0;\r\n\r\n\tfor (let index = 0; index < constructors.length; index++) {\r\n\t\tconst constructor = constructors[index];\r\n\r\n\t\tif (isString(constructor)) {\r\n\t\t\tif (element instanceof window[constructor]) {\r\n\t\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t} else if (element instanceof constructor) {\r\n\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n\t// Use an intermediate object so it errors on incorrect data.\r\n\tconst newData: ElementData = {\r\n\t\ttypes,\r\n\t\tcount: 0,\r\n\t\tcomputedStyle: null,\r\n\t\tcache: {} as any,\r\n\t\tqueueList: {},\r\n\t\tlastAnimationList: {},\r\n\t\tlastFinishList: {},\r\n\t\twindow,\r\n\t};\r\n\r\n\tObject.defineProperty(element, dataName, {\r\n\t\tvalue: newData,\r\n\t});\r\n\r\n\treturn newData;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityState} from \"../../velocity.d\";\r\n\r\n// Constants\r\nimport {CLASSNAME} from \"../constants\";\r\n\r\nconst isClient = window && window === window.window,\r\n\twindowScrollAnchor = isClient && window.pageYOffset !== undefined;\r\n\r\nexport const State: VelocityState = {\r\n\tisClient,\r\n\tisMobile: isClient && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\r\n\tisAndroid: isClient && /Android/i.test(navigator.userAgent),\r\n\tisGingerbread: isClient && /Android 2\\.3\\.[3-7]/i.test(navigator.userAgent),\r\n\tisChrome: isClient && (window as any).chrome,\r\n\tisFirefox: isClient && /Firefox/i.test(navigator.userAgent),\r\n\tprefixElement: isClient && document.createElement(\"div\"),\r\n\twindowScrollAnchor,\r\n\tscrollAnchor: windowScrollAnchor ? window : (!isClient || document.documentElement || document.body.parentNode || document.body),\r\n\tscrollPropertyLeft: windowScrollAnchor ? \"pageXOffset\" : \"scrollLeft\",\r\n\tscrollPropertyTop: windowScrollAnchor ? \"pageYOffset\" : \"scrollTop\",\r\n\tclassName: CLASSNAME,\r\n\tisTicking: false,\r\n\tfirst: undefined,\r\n\tlast: undefined,\r\n\tfirstNew: undefined,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * AnimationCall queue\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {addClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Simple queue management. Un-named queue is directly within the element data,\r\n * named queue is within an object within it.\r\n */\r\nfunction animate(animation: AnimationCall) {\r\n\tconst prev = State.last;\r\n\r\n\tanimation._prev = prev;\r\n\tanimation._next = undefined;\r\n\tif (prev) {\r\n\t\tprev._next = animation;\r\n\t} else {\r\n\t\tState.first = animation;\r\n\t}\r\n\tState.last = animation;\r\n\tif (!State.firstNew) {\r\n\t\tState.firstNew = animation;\r\n\t}\r\n\tconst element = animation.element,\r\n\t\tdata = Data(element);\r\n\r\n\tif (!data.count++) {\r\n\r\n\t\t////////////////////////\r\n\t\t// Feature: Classname //\r\n\t\t////////////////////////\r\n\r\n\t\taddClass(element, State.className);\r\n\t}\r\n}\r\n\r\n/**\r\n * Add an item to an animation queue.\r\n */\r\nexport function queue(element: HTMLorSVGElement, animation: AnimationCall, queueName: string | false): void {\r\n\tconst data = Data(element);\r\n\r\n\tif (queueName !== false) {\r\n\t\t// Store the last animation added so we can use it for the\r\n\t\t// beginning of the next one.\r\n\t\tdata.lastAnimationList[queueName] = animation;\r\n\t}\r\n\tif (queueName === false) {\r\n\t\tanimate(animation);\r\n\t} else {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tlet last = data.queueList[queueName];\r\n\r\n\t\tif (!last) {\r\n\t\t\tif (last === null) {\r\n\t\t\t\tdata.queueList[queueName] = animation;\r\n\t\t\t} else {\r\n\t\t\t\tdata.queueList[queueName] = null;\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twhile (last._next) {\r\n\t\t\t\tlast = last._next;\r\n\t\t\t}\r\n\t\t\tlast._next = animation;\r\n\t\t\tanimation._prev = last;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Start the next animation on this element's queue (named or default).\r\n *\r\n * @returns the next animation that is starting.\r\n */\r\nexport function dequeue(element: HTMLorSVGElement, queueName?: string | boolean, skip?: boolean): AnimationCall {\r\n\tif (queueName !== false) {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tconst data = Data(element),\r\n\t\t\tanimation = data.queueList[queueName];\r\n\r\n\t\tif (animation) {\r\n\t\t\tdata.queueList[queueName] = animation._next || null;\r\n\t\t\tif (!skip) {\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else if (animation === null) {\r\n\t\t\tdelete data.queueList[queueName];\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t}\r\n}\r\n\r\n/**\r\n * Remove an animation from the active animation list. If it has a queue set\r\n * then remember it as the last animation for that queue, and free the one\r\n * that was previously there. If the animation list is completely empty then\r\n * mark us as finished.\r\n */\r\nexport function freeAnimationCall(animation: AnimationCall): void {\r\n\tconst next = animation._next,\r\n\t\tprev = animation._prev,\r\n\t\tqueueName = animation.queue == null ? animation.options.queue : animation.queue;\r\n\r\n\tif (State.firstNew === animation) {\r\n\t\tState.firstNew = next;\r\n\t}\r\n\tif (State.first === animation) {\r\n\t\tState.first = next;\r\n\t} else if (prev) {\r\n\t\tprev._next = next;\r\n\t}\r\n\tif (State.last === animation) {\r\n\t\tState.last = prev;\r\n\t} else if (next) {\r\n\t\tnext._prev = prev;\r\n\t}\r\n\tif (queueName) {\r\n\t\tconst data = Data(animation.element);\r\n\r\n\t\tif (data) {\r\n\t\t\tanimation._next = animation._prev = undefined;\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Call Completion\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityCallback} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {getValue, removeClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {dequeue, freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Call the complete method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callComplete(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.complete as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Complete an animation. This might involve restarting (for loop or repeat\r\n * options). Once it is finished we also check for any callbacks or Promises\r\n * that need updating.\r\n */\r\nexport function completeCall(activeCall: AnimationCall) {\r\n\t// TODO: Check if it's not been completed already\r\n\tconst options = activeCall.options,\r\n\t\tqueue = getValue(activeCall.queue, options.queue),\r\n\t\tisLoop = getValue(activeCall.loop, options.loop, defaults.loop),\r\n\t\tisRepeat = getValue(activeCall.repeat, options.repeat, defaults.repeat),\r\n\t\tisStopped = activeCall._flags & AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\r\n\tif (!isStopped && (isLoop || isRepeat)) {\r\n\r\n\t\t////////////////////\r\n\t\t// Option: Loop //\r\n\t\t// Option: Repeat //\r\n\t\t////////////////////\r\n\r\n\t\tif (isRepeat && isRepeat !== true) {\r\n\t\t\tactiveCall.repeat = isRepeat - 1;\r\n\t\t} else if (isLoop && isLoop !== true) {\r\n\t\t\tactiveCall.loop = isLoop - 1;\r\n\t\t\tactiveCall.repeat = getValue(activeCall.repeatAgain, options.repeatAgain, defaults.repeatAgain);\r\n\t\t}\r\n\t\tif (isLoop) {\r\n\t\t\tactiveCall._flags ^= AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\tif (queue !== false) {\r\n\t\t\t// Can't be called when stopped so no need for an extra check.\r\n\t\t\tData(activeCall.element).lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t}\r\n\t\tactiveCall.timeStart = activeCall.ellapsedTime = activeCall.percentComplete = 0;\r\n\t\tactiveCall._flags &= ~AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t} else {\r\n\t\tconst element = activeCall.element,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (!--data.count && !isStopped) {\r\n\r\n\t\t\t////////////////////////\r\n\t\t\t// Feature: Classname //\r\n\t\t\t////////////////////////\r\n\r\n\t\t\tremoveClass(element, State.className);\r\n\t\t}\r\n\r\n\t\t//////////////////////\r\n\t\t// Option: Complete //\r\n\t\t//////////////////////\r\n\r\n\t\t// If this is the last animation in this list then we can check for\r\n\t\t// and complete calls or Promises.\r\n\t\t// TODO: When deleting an element we need to adjust these values.\r\n\t\tif (options && ++options._completed === options._total) {\r\n\t\t\tif (!isStopped && options.complete) {\r\n\t\t\t\t// We don't call the complete if the animation is stopped,\r\n\t\t\t\t// and we clear the key to prevent it being called again.\r\n\t\t\t\tcallComplete(activeCall);\r\n\t\t\t\toptions.complete = null;\r\n\t\t\t}\r\n\t\t\tconst resolver = options._resolver;\r\n\r\n\t\t\tif (resolver) {\r\n\t\t\t\t// Fulfil the Promise\r\n\t\t\t\tresolver(activeCall.elements as any);\r\n\t\t\t\tdelete options._resolver;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t///////////////////\r\n\t\t// Option: Queue //\r\n\t\t///////////////////\r\n\r\n\t\tif (queue !== false) {\r\n\t\t\t// We only do clever things with queues...\r\n\t\t\tif (!isStopped) {\r\n\t\t\t\t// If we're not stopping an animation, we need to remember\r\n\t\t\t\t// what time it finished so that the next animation in\r\n\t\t\t\t// sequence gets the correct start time.\r\n\t\t\t\tdata.lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t\t}\r\n\t\t\t// Start the next animation in sequence, or delete the queue if\r\n\t\t\t// this was the last one.\r\n\t\t\tdequeue(element, queue);\r\n\t\t}\r\n\t\t// Cleanup any pointers, and remember the last animation etc.\r\n\t\tfreeAnimationCall(activeCall);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\nimport {Data} from \"../data\";\r\nimport {ClassConstructor, constructorCache, constructors, NoCacheNormalizations, Normalizations, NormalizationUnits} from \"./normalizationsObject\";\r\n\r\n/**\r\n * Used to register a normalization. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerNormalization\", \"Element\", \"name\", VelocityNormalizationsFn[, false]);\r\n *\r\n * The second argument is the class of the animatable object. If this is passed\r\n * as a class name (ie, `\"Element\"` -> `window[\"Element\"]`) then this will work\r\n * cross-iframe. If passed as an actual class (ie `Element`) then it will\r\n * attempt to find the class on the window and use that name instead. If it\r\n * can't find it then it will use the class passed, which allows for custom\r\n * animation targets, but will not work cross-iframe boundary.\r\n *\r\n * The fourth argument can be an explicit false, which prevents\r\n * the property from being cached. Please note that this can be dangerous\r\n * for performance!\r\n */\r\nexport function registerNormalization(\r\n\targs?: [ClassConstructor | string, string, VelocityNormalizationsFn]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, boolean]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string, boolean]) {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1],\r\n\t\tcallback = args[2];\r\n\r\n\tif ((isString(constructor) && !(window[constructor] instanceof Object))\r\n\t\t|| (!isString(constructor) && !(constructor instanceof Object))) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' constructor to an invalid value:`, constructor);\r\n\t} else if (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' callback to an invalid value:`, name, callback);\r\n\t} else {\r\n\t\tlet index = constructors.indexOf(constructor),\r\n\t\t\tnextArg = 3;\r\n\r\n\t\tif (index < 0 && !isString(constructor)) {\r\n\t\t\tif (constructorCache.has(constructor)) {\r\n\t\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t\t} else {\r\n\t\t\t\tfor (const property in window) {\r\n\t\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t\t\tindex = constructors.push(property) - 1;\r\n\t\t\t\t\t\t\tNormalizations[index] = {};\r\n\t\t\t\t\t\t\tconstructorCache.set(constructor, property);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (index < 0) {\r\n\t\t\tindex = constructors.push(constructor) - 1;\r\n\t\t\tNormalizations[index] = {};\r\n\t\t}\r\n\t\tNormalizations[index][name] = callback;\r\n\t\tif (isString(args[nextArg])) {\r\n\t\t\tconst unit = args[nextArg++] as string;\r\n\t\t\tlet units = NormalizationUnits[unit];\r\n\r\n\t\t\tif (!units) {\r\n\t\t\t\tunits = NormalizationUnits[unit] = [];\r\n\t\t\t}\r\n\t\t\tunits.push(callback);\r\n\t\t}\r\n\t\tif (args[nextArg] === false) {\r\n\t\t\tNoCacheNormalizations.add(name);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to check if a normalisation exists on a specific class.\r\n */\r\nexport function hasNormalization(args?: [ClassConstructor | string, string]): boolean {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1];\r\n\tlet index = constructors.indexOf(constructor);\r\n\r\n\tif (index < 0 && !isString(constructor)) {\r\n\t\tif (constructorCache.has(constructor)) {\r\n\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t} else {\r\n\t\t\tfor (const property in window) {\r\n\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn index >= 0 && Normalizations[index].hasOwnProperty(name);\r\n}\r\n\r\n/**\r\n * Get the unit to add to a unitless number based on the normalization used.\r\n */\r\nexport function getNormalizationUnit(fn: VelocityNormalizationsFn) {\r\n\tfor (const unit in NormalizationUnits) {\r\n\t\tif (NormalizationUnits[unit].includes(fn)) {\r\n\t\t\treturn unit;\r\n\t\t}\r\n\t}\r\n\r\n\treturn \"\";\r\n}\r\n\r\n/**\r\n * Get the normalization for an element and propertyName combination. This\r\n * value should be cached at asking time, as it may change if the user adds\r\n * more normalizations.\r\n */\r\nexport function getNormalization(element: HTMLorSVGElement, propertyName: string) {\r\n\tconst data = Data(element);\r\n\tlet fn: VelocityNormalizationsFn;\r\n\r\n\tfor (let index = constructors.length - 1, types = data.types; !fn && index >= 0; index--) {\r\n\t\tif (types & (1 << index)) { // tslint:disable-line:no-bitwise\r\n\t\t\tfn = Normalizations[index][propertyName];\r\n\t\t}\r\n\t}\r\n\r\n\treturn fn;\r\n}\r\n\r\nregisterAction([\"registerNormalization\", registerNormalization]);\r\nregisterAction([\"hasNormalization\", hasNormalization]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\n\r\n/**\r\n * The singular setPropertyValue, which routes the logic for all\r\n * normalizations.\r\n */\r\nexport function setPropertyValue(element: HTMLorSVGElement, propertyName: string, propertyValue: any, fn?: VelocityNormalizationsFn) {\r\n\tconst noCache = NoCacheNormalizations.has(propertyName),\r\n\t\tdata = !noCache && Data(element);\r\n\r\n\tif (noCache || (data && data.cache[propertyName] !== propertyValue)) {\r\n\t\t// By setting it to undefined we force a true \"get\" later\r\n\t\tif (!noCache) {\r\n\t\t\tdata.cache[propertyName] = propertyValue || undefined;\r\n\t\t}\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tfn(element, propertyValue);\r\n\t\t}\r\n\t\tif (Velocity.debug >= 2) {\r\n\t\t\tconsole.info(`Set \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n/**\r\n * Cache every camelCase match to avoid repeating lookups.\r\n */\r\nconst cache: {[property: string]: string} = {};\r\n\r\n/**\r\n * Camelcase a property name into its JavaScript notation (e.g.\r\n * \"background-color\" ==> \"backgroundColor\"). Camelcasing is used to\r\n * normalize property names between and across calls.\r\n */\r\nexport function camelCase(property: string): string {\r\n\tconst fixed = cache[property];\r\n\r\n\tif (fixed) {\r\n\t\treturn fixed;\r\n\t}\r\n\r\n\treturn cache[property] = property.replace(/-([a-z])/g, ($: string, letter: string) => letter.toUpperCase());\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Constants\r\nconst rxColor6 = /#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/gi,\r\n\trxColor3 = /#([a-f\\d])([a-f\\d])([a-f\\d])/gi,\r\n\trxColorName = /(rgba?\\(\\s*)?(\\b[a-z]+\\b)/g,\r\n\trxRGB = /rgb(a?)\\(([^\\)]+)\\)/gi,\r\n\trxSpaces = /\\s+/g;\r\n\r\n/**\r\n * This is the list of color names -> rgb values. The object is in here so\r\n * that the actual name conversion can be in a separate file and not\r\n * included for custom builds.\r\n */\r\nexport const ColorNames: {[name: string]: string} = {};\r\n\r\n/**\r\n * Convert a hex list to an rgba value. Designed to be used in replace.\r\n */\r\nfunction makeRGBA(ignore: any, r: string, g: string, b: string): string {\r\n\treturn `rgba(${parseInt(r, 16)},${parseInt(g, 16)},${parseInt(b, 16)},1)`;\r\n}\r\n\r\n/**\r\n * Replace any css colour name with its rgba() value. It is possible to use\r\n * the name within an \"rgba(blue, 0.4)\" string this way.\r\n */\r\nexport function fixColors(str: string): string {\r\n\treturn str\r\n\t\t.replace(rxColor6, makeRGBA)\r\n\t\t.replace(rxColor3, ($0, r, g, b) => {\r\n\t\t\treturn makeRGBA($0, r + r, g + g, b + b);\r\n\t\t})\r\n\t\t.replace(rxColorName, ($0, $1, $2) => {\r\n\t\t\tif (ColorNames[$2]) {\r\n\t\t\t\treturn ($1 ? $1 : \"rgba(\") + ColorNames[$2] + ($1 ? \"\" : \",1)\");\r\n\t\t\t}\r\n\r\n\t\t\treturn $0;\r\n\t\t})\r\n\t\t.replace(rxRGB, ($0, $1, $2: string) => {\r\n\t\t\treturn `rgba(${$2.replace(rxSpaces, \"\") + ($1 ? \"\" : \",1\")})`;\r\n\t\t});\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"./getPropertyValue\";\r\n\r\n/**\r\n * Figure out the dimensions for this width / height based on the\r\n * potential borders and whether we care about them.\r\n */\r\nexport function augmentDimension(element: HTMLorSVGElement, name: \"width\" | \"height\", wantInner: boolean): number {\r\n\tconst isBorderBox = getPropertyValue(element, \"boxSizing\")\r\n\t\t.toString()\r\n\t\t.toLowerCase() === \"border-box\";\r\n\r\n\tif (isBorderBox === wantInner) {\r\n\t\t// in box-sizing mode, the CSS width / height accessors already\r\n\t\t// give the outerWidth / outerHeight.\r\n\t\tconst sides = name === \"width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\r\n\t\t\tfields = [`padding${sides[0]}`, `padding${sides[1]}`, `border${sides[0]}Width`, `border${sides[1]}Width`];\r\n\t\tlet augment = 0;\r\n\r\n\t\tfor (const field of fields) {\r\n\t\t\tconst value = parseFloat(getPropertyValue(element, field));\r\n\r\n\t\t\tif (!isNaN(value)) {\r\n\t\t\t\taugment += value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn wantInner ? -augment : augment;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\nimport {augmentDimension} from \"./augmentDimension\";\r\nimport {setPropertyValue} from \"./setPropertyValue\";\r\n\r\n/**\r\n * Get the width or height of an element, pulled out as it can be used when the\r\n * in two locations so don't want to repeat it.\r\n */\r\nfunction getWidthHeight(element: HTMLorSVGElement, property: \"width\" | \"height\"): string {\r\n\treturn (element.getBoundingClientRect()[property] + augmentDimension(element, property, true)) + \"px\";\r\n}\r\n\r\n// TODO: This is still a complete mess\r\nexport function computePropertyValue(element: HTMLorSVGElement, property: string): string {\r\n\tconst data = Data(element),\r\n\t\t// If computedStyle is cached, use it. If not then get the correct one\r\n\t\t// for the element to support cross-iframe boundaries.\r\n\t\tcomputedStyle = data.computedStyle ? data.computedStyle : data.window.getComputedStyle(element, null);\r\n\tlet computedValue: string | number = 0;\r\n\r\n\tif (!data.computedStyle) {\r\n\t\tdata.computedStyle = computedStyle;\r\n\t}\r\n\tif (computedStyle[\"display\"] === \"none\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\t// Browsers do not return height and width values for elements\r\n\t\t\t\t// that are set to display:\"none\". Thus, we temporarily toggle\r\n\t\t\t\t// display to the element type's default value.\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"auto\");\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"none\");\r\n\r\n\t\t\t\treturn String(computedValue);\r\n\t\t}\r\n\t}\r\n\r\n\t/* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\r\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\r\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\r\n\t/* TODO: There is a borderColor normalisation in legacy/ - figure out where this is needed... */\r\n\r\n\tcomputedValue = computedStyle[property];\r\n\t/* Fall back to the property's style value (if defined) when computedValue returns nothing,\r\n\t which can happen when the element hasn't been painted. */\r\n\tif (!computedValue) {\r\n\t\tcomputedValue = element.style[property];\r\n\t}\r\n\t/* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\r\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\r\n\t effect as being set to 0, so no conversion is necessary.) */\r\n\t/* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\r\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\r\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\r\n\tif (computedValue === \"auto\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"top\":\r\n\t\t\tcase \"left\":\r\n\t\t\t\tconst topLeft = true;\r\n\t\t\tcase \"right\":\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tconst position = getPropertyValue(element, \"position\");\r\n\r\n\t\t\t\tif (position === \"fixed\" || (topLeft && position === \"absolute\")) {\r\n\t\t\t\t\t// Note: this has no pixel unit on its returned values,\r\n\t\t\t\t\t// we re-add it here to conform with\r\n\t\t\t\t\t// computePropertyValue's behavior.\r\n\t\t\t\t\tcomputedValue = element.getBoundingClientRect[property] + \"px\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t// Deliberate fallthrough!\r\n\t\t\tdefault:\r\n\t\t\t\tcomputedValue = \"0px\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn computedValue ? String(computedValue) : \"\";\r\n}\r\n\r\n/**\r\n * Get a property value. This will grab via the cache if it exists, then\r\n * via any normalisations.\r\n */\r\nexport function getPropertyValue(element: HTMLorSVGElement, propertyName: string, fn?: VelocityNormalizationsFn, skipCache?: boolean): string {\r\n\tconst data = Data(element);\r\n\tlet propertyValue: string;\r\n\r\n\tif (NoCacheNormalizations.has(propertyName)) {\r\n\t\tskipCache = true;\r\n\t}\r\n\tif (!skipCache && data && data.cache[propertyName] != null) {\r\n\t\tpropertyValue = data.cache[propertyName];\r\n\t} else {\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tpropertyValue = fn(element);\r\n\t\t\tif (data) {\r\n\t\t\t\tdata.cache[propertyName] = propertyValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (Velocity.debug >= 2) {\r\n\t\tconsole.info(`Get \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t}\r\n\r\n\treturn propertyValue;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tweens\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, Sequence,\r\n\tVelocityProperty, VelocityPropertyFn, VelocityPropertyValueFn, VelocityTween,\r\n} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isNumber, isString} from \"../types\";\r\nimport {cloneArray, getValue} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {fixColors} from \"./css/fixColors\";\r\nimport {getPropertyValue} from \"./css/getPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {getNormalization, getNormalizationUnit} from \"./normalizations/normalizations\";\r\nimport {validateEasing} from \"./options\";\r\nimport {State} from \"./state\";\r\n\r\n// Constants\r\nconst rxHex = /^#([A-f\\d]{3}){1,2}$/i,\r\n\tcommands: {\r\n\t\t[type: string]: (\r\n\t\t\tvalue: any,\r\n\t\t\telement: HTMLorSVGElement,\r\n\t\t\telements: HTMLorSVGElement[],\r\n\t\t\telementArrayIndex: number,\r\n\t\t\tpropertyName: string,\r\n\t\t\ttween: VelocityTween) => string;\r\n\t} = {\r\n\t\t\tfunction: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn (value as any as VelocityPropertyValueFn).call(element, elementArrayIndex, elements.length);\r\n\t\t\t},\r\n\t\t\tnumber: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn String(value) + getNormalizationUnit(tween.fn);\r\n\t\t\t},\r\n\t\t\tstring: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(value);\r\n\t\t\t},\r\n\t\t\tundefined: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(getPropertyValue(element, propertyName, tween.fn) || \"\");\r\n\t\t\t},\r\n\t\t};\r\n\r\n/**\r\n * Expand a VelocityProperty argument into a valid sparse Tween array. This\r\n * pre-allocates the array as it is then the correct size and slightly\r\n * faster to access.\r\n */\r\nexport function expandProperties(animation: AnimationCall, properties: Properties) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telements = animation.elements,\r\n\t\telement = animation.element,\r\n\t\telementArrayIndex = elements.indexOf(element),\r\n\t\tdata = Data(element),\r\n\t\tqueue = getValue(animation.queue, animation.options.queue),\r\n\t\tduration = getValue(animation.options.duration, defaults.duration);\r\n\r\n\tfor (const property in properties) {\r\n\t\tif (properties.hasOwnProperty(property)) {\r\n\t\t\tconst propertyName = camelCase(property),\r\n\t\t\t\tfn = getNormalization(element, propertyName);\r\n\t\t\tlet valueData = properties[property];\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (valueData == null) {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to no value supplied.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst tween: VelocityTween = tweens[propertyName] = {} as any;\r\n\t\t\tlet endValue: string,\r\n\t\t\t\tstartValue: string;\r\n\r\n\t\t\ttween.fn = fn;\r\n\t\t\tif (isFunction(valueData)) {\r\n\t\t\t\t// If we have a function as the main argument then resolve\r\n\t\t\t\t// it first, in case it returns an array that needs to be\r\n\t\t\t\t// split.\r\n\t\t\t\tvalueData = (valueData as VelocityPropertyFn).call(element, elementArrayIndex, elements.length, elements);\r\n\t\t\t}\r\n\t\t\tif (Array.isArray(valueData)) {\r\n\t\t\t\t// valueData is an array in the form of\r\n\t\t\t\t// [ endValue, [, easing] [, startValue] ]\r\n\t\t\t\tconst arr1 = valueData[1],\r\n\t\t\t\t\tarr2 = valueData[2];\r\n\r\n\t\t\t\tendValue = valueData[0] as any;\r\n\t\t\t\tif ((isString(arr1) && (/^[\\d-]/.test(arr1) || rxHex.test(arr1))) || isFunction(arr1) || isNumber(arr1)) {\r\n\t\t\t\t\tstartValue = arr1 as any;\r\n\t\t\t\t} else if ((isString(arr1) && Easings[arr1]) || Array.isArray(arr1)) {\r\n\t\t\t\t\ttween.easing = validateEasing(arr1, duration);\r\n\t\t\t\t\tstartValue = arr2 as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstartValue = arr1 || arr2 as any;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tendValue = valueData as any;\r\n\t\t\t}\r\n\t\t\ttween.end = commands[typeof endValue](endValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\tif (startValue != null || (queue === false || data.queueList[queue] === undefined)) {\r\n\t\t\t\ttween.start = commands[typeof startValue](startValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// TODO: Needs a better match for \"translate3d\" etc - a number must be preceded by some form of break...\r\nconst rxToken = /((?:[+\\-*/]=)?(?:[+-]?\\d*\\.\\d+|[+-]?\\d+)[a-z%]*|(?:.(?!$|[+-]?\\d|[+\\-*/]=[+-]?\\d))+.|.)/g,\r\n\trxNumber = /^([+\\-*/]=)?([+-]?\\d*\\.\\d+|[+-]?\\d+)(.*)$/;\r\n\r\n/**\r\n * Find a pattern between multiple strings, return a VelocitySequence with\r\n * the pattern and the tokenised values.\r\n *\r\n * If number then animate.\r\n * If a string then must match.\r\n * If units then convert between them by wrapping in a calc().\r\n * - If already in a calc then nest another layer.\r\n * If in an rgba() then the first three numbers are rounded.\r\n */\r\nexport function findPattern(parts: ReadonlyArray, propertyName: string): Sequence {\r\n\tconst partsLength = parts.length,\r\n\t\ttokens: string[][] = [],\r\n\t\tindexes: number[] = [];\r\n\tlet numbers: boolean;\r\n\r\n\t// First tokenise the strings - these have all values, we will pull\r\n\t// numbers later.\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tif (isString(parts[part])) {\r\n\t\t\ttokens[part] = cloneArray(parts[part].match(rxToken));\r\n\t\t\tindexes[part] = 0;\r\n\t\t\t// If it matches more than one thing then we've got a number.\r\n\t\t\tnumbers = numbers || tokens[part].length > 1;\r\n\t\t\t//console.log(`tokens:`, parts[part], tokens[part])\r\n\t\t} else {\r\n\t\t\t// We have an incomplete lineup, it will get tried again later...\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tconst sequence: Sequence = [] as any,\r\n\t\tpattern = (sequence.pattern = []) as (string | boolean)[],\r\n\t\taddString = (text: string) => {\r\n\t\t\tif (isString(pattern[pattern.length - 1])) {\r\n\t\t\t\tpattern[pattern.length - 1] += text;\r\n\t\t\t} else if (text) {\r\n\t\t\t\tpattern.push(text);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\treturnStringType = () => {\r\n\t\t\tif (numbers || pattern.length > 1) {\r\n\t\t\t\t//console.error(`Velocity: Trying to pattern match mis-matched strings \"${propertyName}\":`, parts);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst isDisplay = propertyName === \"display\",\r\n\t\t\t\tisVisibility = propertyName === \"visibility\";\r\n\r\n\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\tconst value = parts[part];\r\n\r\n\t\t\t\tsequence[part][0] = value;\r\n\t\t\t\t// Don't care about duration...\r\n\t\t\t\tsequence[part].easing = validateEasing((isDisplay && value === \"none\") || (isVisibility && value === \"hidden\") || (!isDisplay && !isVisibility) ? \"at-end\" : \"at-start\", 400);\r\n\t\t\t}\r\n\t\t\tpattern[0] = false;\r\n\r\n\t\t\treturn sequence;\r\n\t\t};\r\n\tlet more = true;\r\n\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tsequence[part] = [];\r\n\t}\r\n\twhile (more) {\r\n\t\tconst bits: ([number, string] | [number, string, boolean])[] = [],\r\n\t\t\tunits: string[] = [];\r\n\t\tlet text: string,\r\n\t\t\tisUnitless = false,\r\n\t\t\thasNumbers = false;\r\n\r\n\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\tconst index = indexes[part]++,\r\n\t\t\t\ttoken = tokens[part][index];\r\n\r\n\t\t\tif (token) {\r\n\t\t\t\tconst num = token.match(rxNumber); // [ignore, change, number, unit]\r\n\r\n\t\t\t\tif (num) {\r\n\t\t\t\t\t// It's a number, possibly with a += change and unit.\r\n\t\t\t\t\tif (text) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst digits = parseFloat(num[2]),\r\n\t\t\t\t\t\tunit = num[3],\r\n\t\t\t\t\t\tchange = num[1] ? num[1][0] + unit : undefined,\r\n\t\t\t\t\t\tchangeOrUnit = change || unit;\r\n\r\n\t\t\t\t\tif (!units.includes(changeOrUnit)) {\r\n\t\t\t\t\t\t// Will be an empty string at the least.\r\n\t\t\t\t\t\tunits.push(changeOrUnit);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!unit) {\r\n\t\t\t\t\t\tif (digits) {\r\n\t\t\t\t\t\t\thasNumbers = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tisUnitless = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbits[part] = change ? [digits, changeOrUnit, true] : [digits, changeOrUnit];\r\n\t\t\t\t} else if (bits.length) {\r\n\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// It's a string.\r\n\t\t\t\t\tif (!text) {\r\n\t\t\t\t\t\ttext = token;\r\n\t\t\t\t\t} else if (text !== token) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!part) {\r\n\t\t\t\tfor (; part < partsLength; part++) {\r\n\t\t\t\t\tconst index2 = indexes[part]++;\r\n\r\n\t\t\t\t\tif (tokens[part][index2]) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// IMPORTANT: This is the exit point.\r\n\t\t\t\tmore = false;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t// Different\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (text) {\r\n\t\t\taddString(text);\r\n\t\t} else if (units.length) {\r\n\t\t\tif (units.length === 2 && isUnitless && !hasNumbers) {\r\n\t\t\t\t// If we only have two units, and one is empty, and it's only empty on \"0\", then treat us as having one unit\r\n\t\t\t\tunits.splice(units[0] ? 1 : 0, 1);\r\n\t\t\t}\r\n\t\t\tif (units.length === 1) {\r\n\t\t\t\t// All the same units, so append number then unit.\r\n\t\t\t\tconst unit = units[0],\r\n\t\t\t\t\tfirstLetter = unit[0];\r\n\r\n\t\t\t\tswitch (firstLetter) {\r\n\t\t\t\t\tcase \"+\":\r\n\t\t\t\t\tcase \"-\":\r\n\t\t\t\t\tcase \"*\":\r\n\t\t\t\t\tcase \"/\":\r\n\t\t\t\t\t\tif (propertyName) {\r\n\t\t\t\t\t\t\tconsole.error(`Velocity: The first property must not contain a relative function \"${propertyName}\":`, parts);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tpattern.push(false);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(bits[part][0]);\r\n\t\t\t\t}\r\n\t\t\t\taddString(unit);\r\n\t\t\t} else {\r\n\t\t\t\t// Multiple units, so must be inside a calc.\r\n\t\t\t\taddString(\"calc(\");\r\n\t\t\t\tconst patternCalc = pattern.length - 1; // Store the beginning of our calc.\r\n\r\n\t\t\t\tfor (let i = 0; i < units.length; i++) {\r\n\t\t\t\t\tconst unit = units[i],\r\n\t\t\t\t\t\tfirstLetter = unit[0],\r\n\t\t\t\t\t\tisComplex = firstLetter === \"*\" || firstLetter === \"/\",\r\n\t\t\t\t\t\tisMaths = isComplex || firstLetter === \"+\" || firstLetter === \"-\";\r\n\r\n\t\t\t\t\tif (isComplex) {\r\n\t\t\t\t\t\t// TODO: Not sure this should be done automatically!\r\n\t\t\t\t\t\tpattern[patternCalc] += \"(\";\r\n\t\t\t\t\t\taddString(\")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i) {\r\n\t\t\t\t\t\taddString(` ${isMaths ? firstLetter : \"+\"} `);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpattern.push(false);\r\n\t\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t\tconst bit = bits[part],\r\n\t\t\t\t\t\t\tvalue = bit[1] === unit\r\n\t\t\t\t\t\t\t\t? bit[0]\r\n\t\t\t\t\t\t\t\t: bit.length === 3\r\n\t\t\t\t\t\t\t\t\t? sequence[part - 1][sequence[part - 1].length - 1]\r\n\t\t\t\t\t\t\t\t\t: isComplex ? 1 : 0;\r\n\r\n\t\t\t\t\t\t(sequence[part] as any[]).push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\taddString(isMaths ? unit.substring(1) : unit);\r\n\t\t\t\t}\r\n\t\t\t\taddString(\")\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// We've got here, so a valid sequence - now check and fix RGB rounding\r\n\t// and calc() nesting...\r\n\t// TODO: Nested calc(a + calc(b + c)) -> calc(a + (b + c))\r\n\tfor (let i = 0, inRGB = 0; i < pattern.length; i++) {\r\n\t\tconst text = pattern[i];\r\n\r\n\t\tif (isString(text)) {\r\n\t\t\tif (inRGB && (text as string).indexOf(\",\") >= 0) {\r\n\t\t\t\tinRGB++;\r\n\t\t\t} else if ((text as string).indexOf(\"rgb\") >= 0) {\r\n\t\t\t\tinRGB = 1;\r\n\t\t\t}\r\n\t\t} else if (inRGB) {\r\n\t\t\tif (inRGB < 4) {\r\n\t\t\t\tpattern[i] = true;\r\n\t\t\t} else {\r\n\t\t\t\tinRGB = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn sequence;\r\n}\r\n\r\n/**\r\n * Convert a string-based tween with start and end strings, into a pattern\r\n * based tween with arrays.\r\n */\r\nfunction explodeTween(propertyName: string, tween: VelocityTween, duration: number, starting?: boolean) {\r\n\tconst startValue: string = tween.start,\r\n\t\tendValue: string = tween.end;\r\n\r\n\tif (!isString(endValue) || !isString(startValue)) {\r\n\t\treturn;\r\n\t}\r\n\tlet sequence: Sequence = findPattern([startValue, endValue], propertyName);\r\n\r\n\tif (!sequence && starting) {\r\n\t\t// This little piece will take a startValue, split out the\r\n\t\t// various numbers in it, then copy the endValue into the\r\n\t\t// startValue while replacing the numbers in it to match the\r\n\t\t// original start numbers as a repeating sequence.\r\n\t\t// Finally this function will run again with the new\r\n\t\t// startValue and a now matching pattern.\r\n\t\tconst startNumbers = startValue.match(/\\d\\.?\\d*/g) || [\"0\"],\r\n\t\t\tcount = startNumbers.length;\r\n\t\tlet index = 0;\r\n\r\n\t\tsequence = findPattern([endValue.replace(/\\d+\\.?\\d*/g, () => {\r\n\t\t\treturn startNumbers[index++ % count];\r\n\t\t}), endValue], propertyName);\r\n\t}\r\n\tif (sequence) {\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`Velocity: Sequence found:`, sequence);\r\n\t\t}\r\n\t\tsequence[0].percent = 0;\r\n\t\tsequence[1].percent = 1;\r\n\t\ttween.sequence = sequence;\r\n\t\tswitch (tween.easing) {\r\n\t\t\tcase Easings[\"at-start\"]:\r\n\t\t\tcase Easings[\"during\"]:\r\n\t\t\tcase Easings[\"at-end\"]:\r\n\t\t\t\tsequence[0].easing = sequence[1].easing = tween.easing;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Expand all queued animations that haven't gone yet\r\n *\r\n * This will automatically expand the properties map for any recently added\r\n * animations so that the start and end values are correct.\r\n */\r\nexport function validateTweens(activeCall: AnimationCall) {\r\n\t// This might be called on an already-ready animation\r\n\tif (State.firstNew === activeCall) {\r\n\t\tState.firstNew = activeCall._next;\r\n\t}\r\n\t// Check if we're actually already ready\r\n\tif (activeCall._flags & AnimationFlags.EXPANDED) { // tslint:disable-line:no-bitwise\r\n\t\treturn;\r\n\t}\r\n\tconst element = activeCall.element,\r\n\t\ttweens = activeCall.tweens,\r\n\t\tduration = getValue(activeCall.options.duration, defaults.duration);\r\n\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const propertyName in tweens) {\r\n\t\tconst tween = tweens[propertyName];\r\n\r\n\t\tif (tween.start == null) {\r\n\t\t\t// Get the start value as it's not been passed in\r\n\t\t\tconst startValue = getPropertyValue(activeCall.element, propertyName);\r\n\r\n\t\t\tif (isString(startValue)) {\r\n\t\t\t\ttween.start = fixColors(startValue) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration, true);\r\n\t\t\t} else if (!Array.isArray(startValue)) {\r\n\t\t\t\tconsole.warn(`bad type`, tween, propertyName, startValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`tweensContainer \"${propertyName}\": ${JSON.stringify(tween)}`, element);\r\n\t\t}\r\n\t}\r\n\tactiveCall._flags |= AnimationFlags.EXPANDED; // tslint:disable-line:no-bitwise\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tick\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, TweenStep, VelocityCallback, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {now} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {completeCall} from \"./complete\";\r\nimport {setPropertyValue} from \"./css/setPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {linearEasing} from \"./easing/easings\";\r\nimport {freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\nimport {validateTweens} from \"./tweens\";\r\n\r\n/**\r\n * Call the begin method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nexport function callBegin(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.begin as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Call the progress method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callProgress(activeCall: AnimationCall, timeCurrent: number) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements,\r\n\t\t\tpercentComplete = activeCall.percentComplete,\r\n\t\t\toptions = activeCall.options,\r\n\t\t\ttweenValue = activeCall.tween;\r\n\r\n\t\t(activeCall.options.progress as VelocityProgress).call(elements,\r\n\t\t\telements,\r\n\t\t\tpercentComplete,\r\n\t\t\tMath.max(0, activeCall.timeStart + (activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaults.duration) - timeCurrent),\r\n\t\t\ttweenValue !== undefined ? tweenValue : String(percentComplete * 100),\r\n\t\t\tactiveCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\nfunction asyncCallbacks() {\r\n\tlet activeCall: AnimationCall,\r\n\t\tnextCall: AnimationCall;\r\n\t// Callbacks and complete that might read the DOM again.\r\n\r\n\t// Progress callback\r\n\tfor (activeCall = firstProgress; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextProgress;\r\n\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\tcallProgress(activeCall, lastTick);\r\n\t}\r\n\t// Complete animations, including complete callback or looping\r\n\tfor (activeCall = firstComplete; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextComplete;\r\n\t\t/* If this call has finished tweening, pass it to complete() to handle call cleanup. */\r\n\t\tcompleteCall(activeCall);\r\n\t}\r\n}\r\n\r\n/**************\r\n Timing\r\n **************/\r\n\r\nconst FRAME_TIME = 1000 / 60,\r\n\t/**\r\n\t * Shim for window.performance in case it doesn't exist\r\n\t */\r\n\tperformance = (() => {\r\n\t\tconst perf = window.performance || {} as Performance;\r\n\r\n\t\tif (typeof perf.now !== \"function\") {\r\n\t\t\tconst nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : now();\r\n\r\n\t\t\tperf.now = () => {\r\n\t\t\t\treturn now() - nowOffset;\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn perf;\r\n\t})(),\r\n\t/**\r\n\t * Proxy function for when rAF is not available.\r\n\t *\r\n\t * This should hopefully never be used as the browsers often throttle\r\n\t * this to less than one frame per second in the background, making it\r\n\t * completely unusable.\r\n\t */\r\n\trAFProxy = (callback: FrameRequestCallback) => {\r\n\t\treturn setTimeout(callback, Math.max(0, FRAME_TIME - (performance.now() - lastTick)));\r\n\t},\r\n\t/**\r\n\t * Either requestAnimationFrame, or a shim for it.\r\n\t */\r\n\trAFShim = window.requestAnimationFrame || rAFProxy;\r\n\r\n/**\r\n * Set if we are currently inside a tick() to prevent double-calling.\r\n */\r\nlet ticking: boolean,\r\n\t/**\r\n\t * A background WebWorker that sends us framerate messages when we're in\r\n\t * the background. Without this we cannot maintain frame accuracy.\r\n\t */\r\n\tworker: Worker,\r\n\t/**\r\n\t * The first animation with a Progress callback.\r\n\t */\r\n\tfirstProgress: AnimationCall,\r\n\t/**\r\n\t * The first animation with a Complete callback.\r\n\t */\r\n\tfirstComplete: AnimationCall;\r\n\r\n/**\r\n * The time that the last animation frame ran at. Set from tick(), and used\r\n * for missing rAF (ie, when not in focus etc).\r\n */\r\nexport let lastTick: number = 0;\r\n\r\n/**\r\n * WebWorker background function.\r\n *\r\n * When we're in the background this will send us a msg every tick, when in\r\n * the foreground it won't.\r\n *\r\n * When running in the background the browser reduces allowed CPU etc, so\r\n * we raun at 30fps instead of 60fps.\r\n */\r\nfunction workerFn(this: Worker) {\r\n\tlet interval: any;\r\n\r\n\tthis.onmessage = (e) => {\r\n\t\tswitch (e.data) {\r\n\t\t\tcase true:\r\n\t\t\t\tif (!interval) {\r\n\t\t\t\t\tinterval = setInterval(() => {\r\n\t\t\t\t\t\tthis.postMessage(true);\r\n\t\t\t\t\t}, 1000 / 30);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase false:\r\n\t\t\t\tif (interval) {\r\n\t\t\t\t\tclearInterval(interval);\r\n\t\t\t\t\tinterval = 0;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthis.postMessage(e.data);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n}\r\n\r\ntry {\r\n\t// Create the worker - this might not be supported, hence the try/catch.\r\n\tworker = new Worker(URL.createObjectURL(new Blob([`(${workerFn})()`])));\r\n\t// Whenever the worker sends a message we tick()\r\n\tworker.onmessage = (e: MessageEvent) => {\r\n\t\tif (e.data === true) {\r\n\t\t\ttick();\r\n\t\t} else {\r\n\t\t\tasyncCallbacks();\r\n\t\t}\r\n\t};\r\n\t// And watch for going to the background to start the WebWorker running.\r\n\tif (!State.isMobile && document.hidden !== undefined) {\r\n\t\tdocument.addEventListener(\"visibilitychange\", () => {\r\n\t\t\tworker.postMessage(State.isTicking && document.hidden);\r\n\t\t});\r\n\t}\r\n} catch (e) {\r\n\t/*\r\n\t * WebWorkers are not supported in this format. This can happen in IE10\r\n\t * where it can't create one from a blob this way. We fallback, but make\r\n\t * no guarantees towards accuracy in this case.\r\n\t */\r\n}\r\n\r\n/**\r\n * Called on every tick, preferably through rAF. This is reponsible for\r\n * initialising any new animations, then starting any that need starting.\r\n * Finally it will expand any tweens and set the properties relating to\r\n * them. If there are any callbacks relating to the animations then they\r\n * will attempt to call at the end (with the exception of \"begin\").\r\n */\r\nexport function tick(timestamp?: number | boolean) {\r\n\tif (ticking) {\r\n\t\t// Should never happen - but if we've swapped back from hidden to\r\n\t\t// visibile then we want to make sure\r\n\t\treturn;\r\n\t}\r\n\tticking = true;\r\n\t/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\r\n\t We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\r\n\t the browser's next tick sync time occurs, which results in the first elements subjected to Velocity\r\n\t calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore\r\n\t the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated\r\n\t by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */\r\n\tif (timestamp !== false) {\r\n\t\tconst timeCurrent = performance.now(),\r\n\t\t\tdeltaTime = lastTick ? timeCurrent - lastTick : FRAME_TIME,\r\n\t\t\tdefaultSpeed = defaults.speed,\r\n\t\t\tdefaultEasing = defaults.easing,\r\n\t\t\tdefaultDuration = defaults.duration;\r\n\t\tlet activeCall: AnimationCall,\r\n\t\t\tnextCall: AnimationCall,\r\n\t\t\tlastProgress: AnimationCall,\r\n\t\t\tlastComplete: AnimationCall;\r\n\r\n\t\tfirstProgress = null;\r\n\t\tfirstComplete = null;\r\n\t\tif (deltaTime >= defaults.minFrameTime || !lastTick) {\r\n\t\t\tlastTick = timeCurrent;\r\n\r\n\t\t\t/********************\r\n\t\t\t Call Iteration\r\n\t\t\t ********************/\r\n\r\n\t\t\t// Expand any tweens that might need it.\r\n\t\t\twhile (State.firstNew) {\r\n\t\t\t\tvalidateTweens(State.firstNew);\r\n\t\t\t}\r\n\t\t\t// Iterate through each active call.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = activeCall._next) {\r\n\t\t\t\tconst element = activeCall.element,\r\n\t\t\t\t\tdata = Data(element);\r\n\r\n\t\t\t\t// Check to see if this element has been deleted midway\r\n\t\t\t\t// through the animation. If it's gone then end this\r\n\t\t\t\t// animation.\r\n\t\t\t\tif (!element.parentNode || !data) {\r\n\t\t\t\t\t// TODO: Remove safely - decrease count, delete data, remove from arrays\r\n\t\t\t\t\tfreeAnimationCall(activeCall);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tconst options = activeCall.options,\r\n\t\t\t\t\tflags = activeCall._flags;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// If this is the first time that this call has been\r\n\t\t\t\t// processed by tick() then we assign timeStart now so that\r\n\t\t\t\t// it's value is as close to the real animation start time\r\n\t\t\t\t// as possible.\r\n\t\t\t\tif (!timeStart) {\r\n\t\t\t\t\tconst queue = activeCall.queue != null ? activeCall.queue : options.queue;\r\n\r\n\t\t\t\t\ttimeStart = timeCurrent - deltaTime;\r\n\t\t\t\t\tif (queue !== false) {\r\n\t\t\t\t\t\ttimeStart = Math.max(timeStart, data.lastFinishList[queue] || 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall.timeStart = timeStart;\r\n\t\t\t\t}\r\n\t\t\t\t// If this animation is paused then skip processing unless\r\n\t\t\t\t// it has been set to resume.\r\n\t\t\t\tif (flags & AnimationFlags.PAUSED) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// Update the time start to accomodate the paused\r\n\t\t\t\t\t// completion amount.\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Check if this animation is ready - if it's synced then it\r\n\t\t\t\t// needs to wait for all other animations in the sync\r\n\t\t\t\tif (!(flags & AnimationFlags.READY)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.READY; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\toptions._ready++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Need to split the loop, as ready sync animations must all get\r\n\t\t\t// the same start time.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = nextCall) {\r\n\t\t\t\tconst flags = activeCall._flags;\r\n\r\n\t\t\t\tnextCall = activeCall._next;\r\n\t\t\t\tif (!(flags & AnimationFlags.READY) || (flags & AnimationFlags.PAUSED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst options = activeCall.options;\r\n\r\n\t\t\t\tif ((flags & AnimationFlags.SYNC) && options._ready < options._total) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst speed = activeCall.speed != null ? activeCall.speed : options.speed != null ? options.speed : defaultSpeed;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tif (!(flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tconst delay = activeCall.delay != null ? activeCall.delay : options.delay;\r\n\r\n\t\t\t\t\t// Make sure anything we've delayed doesn't start\r\n\t\t\t\t\t// animating yet, there might still be an active delay\r\n\t\t\t\t\t// after something has been un-paused\r\n\t\t\t\t\tif (delay) {\r\n\t\t\t\t\t\tif (timeStart + (delay / speed) > timeCurrent) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactiveCall.timeStart = timeStart += delay / (delay > 0 ? speed : 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// The begin callback is fired once per call, not once\r\n\t\t\t\t\t// per element, and is passed the full raw DOM element\r\n\t\t\t\t\t// set as both its context and its first argument.\r\n\t\t\t\t\tif (options._started++ === 0) {\r\n\t\t\t\t\t\toptions._first = activeCall;\r\n\t\t\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\t\t\tcallBegin(activeCall);\r\n\t\t\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (speed !== 1) {\r\n\t\t\t\t\t// On the first frame we may have a shorter delta\r\n\t\t\t\t\tconst delta = Math.min(deltaTime, timeCurrent - timeStart);\r\n\t\t\t\t\tactiveCall.timeStart = timeStart += delta * (1 - speed);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options._first === activeCall && options.progress) {\r\n\t\t\t\t\tactiveCall._nextProgress = undefined;\r\n\t\t\t\t\tif (lastProgress) {\r\n\t\t\t\t\t\tlastProgress._nextProgress = lastProgress = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstProgress = lastProgress = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst activeEasing = activeCall.easing != null ? activeCall.easing : options.easing != null ? options.easing : defaultEasing,\r\n\t\t\t\t\tmillisecondsEllapsed = activeCall.ellapsedTime = timeCurrent - timeStart,\r\n\t\t\t\t\tduration = activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaultDuration,\r\n\t\t\t\t\tpercentComplete = activeCall.percentComplete = Velocity.mock ? 1 : Math.min(millisecondsEllapsed / duration, 1),\r\n\t\t\t\t\ttweens = activeCall.tweens,\r\n\t\t\t\t\treverse = flags & AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\r\n\t\t\t\tif (percentComplete === 1) {\r\n\t\t\t\t\tactiveCall._nextComplete = undefined;\r\n\t\t\t\t\tif (lastComplete) {\r\n\t\t\t\t\t\tlastComplete._nextComplete = lastComplete = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstComplete = lastComplete = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const property in tweens) {\r\n\t\t\t\t\t// For every element, iterate through each property.\r\n\t\t\t\t\tconst tween = tweens[property],\r\n\t\t\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\t\t\tpattern = sequence.pattern;\r\n\t\t\t\t\tlet currentValue = \"\",\r\n\t\t\t\t\t\ti = 0;\r\n\r\n\t\t\t\t\tif (pattern) {\r\n\t\t\t\t\t\tconst easingComplete = (tween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\t\t\t\tlet best = 0;\r\n\r\n\t\t\t\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\t\t\t\tbest = j;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\t\t\t\teasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\t\t\t\tconst result = easing(reverse ? 1 - tweenPercent : tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(result) : result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (property !== \"tween\") {\r\n\t\t\t\t\t\t\tif (percentComplete === 1 && currentValue.startsWith(\"calc(0 + \")) {\r\n\t\t\t\t\t\t\t\tcurrentValue = currentValue.replace(/^calc\\(0[^\\d]* \\+ ([^\\(\\)]+)\\)$/, \"$1\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// TODO: To solve an IE<=8 positioning bug, the unit type must be dropped when setting a property value of 0 - add normalisations to legacy\r\n\t\t\t\t\t\t\tsetPropertyValue(activeCall.element, property, currentValue, tween.fn);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Skip the fake 'tween' property as that is only\r\n\t\t\t\t\t\t\t// passed into the progress callback.\r\n\t\t\t\t\t\t\tactiveCall.tween = currentValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Missing pattern:`, property, JSON.stringify(tween[property]));\r\n\t\t\t\t\t\tdelete tweens[property];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (firstProgress || firstComplete) {\r\n\t\t\t\tif (document.hidden) {\r\n\t\t\t\t\tasyncCallbacks();\r\n\t\t\t\t} else if (worker) {\r\n\t\t\t\t\tworker.postMessage(\"\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(asyncCallbacks, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (State.first) {\r\n\t\tState.isTicking = true;\r\n\t\tif (!document.hidden) {\r\n\t\t\trAFShim(tick);\r\n\t\t} else if (!worker) {\r\n\t\t\trAFProxy(tick);\r\n\t\t} else if (timestamp === false) {\r\n\t\t\t// Make sure we turn on the messages.\r\n\t\t\tworker.postMessage(true);\r\n\t\t}\r\n\t} else {\r\n\t\tState.isTicking = false;\r\n\t\tlastTick = 0;\r\n\t\tif (document.hidden && worker) {\r\n\t\t\t// Make sure we turn off the messages.\r\n\t\t\tworker.postMessage(false);\r\n\t\t}\r\n\t}\r\n\tticking = false;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Finish all animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {callBegin} from \"../tick\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be finished, and if so we set the tweens to\r\n * the final value for it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeFinished(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (!(animation._flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t// Copied from tick.ts - ensure that the animation is completely\r\n\t\t\t// valid and run begin() before complete().\r\n\t\t\tconst options = animation.options;\r\n\r\n\t\t\t// The begin callback is fired once per call, not once per\r\n\t\t\t// element, and is passed the full raw DOM element set as both\r\n\t\t\t// its context and its first argument.\r\n\t\t\tif (options._started++ === 0) {\r\n\t\t\t\toptions._first = animation;\r\n\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\tcallBegin(animation);\r\n\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tanimation._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\t// tslint:disable-next-line:forin\r\n\t\tfor (const property in animation.tweens) {\r\n\t\t\tconst tween = animation.tweens[property],\r\n\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\tpattern = sequence.pattern;\r\n\t\t\tlet currentValue = \"\",\r\n\t\t\t\ti = 0;\r\n\r\n\t\t\tif (pattern) {\r\n\t\t\t\tconst endValues = sequence[sequence.length - 1];\r\n\r\n\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\tconst endValue = endValues[i];\r\n\r\n\t\t\t\t\tcurrentValue += endValue == null ? pattern[i] : endValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetPropertyValue(animation.element, property, currentValue, tween.fn);\r\n\t\t}\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the finish action is triggered, the elements' currently active call is\r\n * immediately finished. When an element is finished, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are finished. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n */\r\nfunction finish(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeFinished(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeFinished(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"finish\", finish], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a value from one or more running animations.\r\n */\r\n\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateFpsLimit, validateLoop, validateQueue, validateRepeat,\r\n} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {lastTick} from \"../tick\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Used to map getters for the various AnimationFlags.\r\n */\r\nconst animationFlags: {[key: string]: number} = {\r\n\tisExpanded: AnimationFlags.EXPANDED,\r\n\tisReady: AnimationFlags.READY,\r\n\tisStarted: AnimationFlags.STARTED,\r\n\tisStopped: AnimationFlags.STOPPED,\r\n\tisPaused: AnimationFlags.PAUSED,\r\n\tisSync: AnimationFlags.SYNC,\r\n\tisReverse: AnimationFlags.REVERSE,\r\n};\r\n\r\n/**\r\n * Get or set an option or running AnimationCall data value. If there is no\r\n * value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n */\r\nfunction option(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst key = args[0],\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(queue, true);\r\n\tlet animations: AnimationCall[],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!key) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant key!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// If we're chaining the return value from Velocity then we are only\r\n\t// interested in the values related to that call\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tanimations = elements.velocity.animations;\r\n\t} else {\r\n\t\tanimations = [];\r\n\r\n\t\tfor (let activeCall = State.first; activeCall; activeCall = activeCall._next) {\r\n\t\t\tif (elements.indexOf(activeCall.element) >= 0 && getValue(activeCall.queue, activeCall.options.queue) === queueName) {\r\n\t\t\t\tanimations.push(activeCall);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we're dealing with multiple elements that are pointing at a\r\n\t\t// single running animation, then instead treat them as a single\r\n\t\t// animation.\r\n\t\tif (elements.length > 1 && animations.length > 1) {\r\n\t\t\tlet i = 1,\r\n\t\t\t\toptions = animations[0].options;\r\n\r\n\t\t\twhile (i < animations.length) {\r\n\t\t\t\tif (animations[i++].options !== options) {\r\n\t\t\t\t\toptions = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: this needs to check that they're actually a sync:true animation to merge the results, otherwise the individual values may be different\r\n\t\t\tif (options) {\r\n\t\t\t\tanimations = [animations[0]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// GET\r\n\tif (value === undefined) {\r\n\t\tconst result = [],\r\n\t\t\tflag = animationFlags[key];\r\n\r\n\t\tfor (const animation of animations) {\r\n\t\t\tif (flag === undefined) {\r\n\t\t\t\t// A normal key to get.\r\n\t\t\t\tresult.push(getValue(animation[key], animation.options[key]));\r\n\t\t\t} else {\r\n\t\t\t\t// A flag that we're checking against.\r\n\t\t\t\tresult.push((animation._flags & flag) === 0); // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (elements.length === 1 && animations.length === 1) {\r\n\t\t\t// If only a single animation is found and we're only targetting a\r\n\t\t\t// single element, then return the value directly\r\n\t\t\treturn result[0];\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tlet isPercentComplete: boolean;\r\n\r\n\tswitch (key) {\r\n\t\tcase \"cache\":\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tbreak;\r\n\t\tcase \"begin\":\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tbreak;\r\n\t\tcase \"complete\":\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tbreak;\r\n\t\tcase \"delay\":\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tbreak;\r\n\t\tcase \"duration\":\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tbreak;\r\n\t\tcase \"fpsLimit\":\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tbreak;\r\n\t\tcase \"loop\":\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tbreak;\r\n\t\tcase \"percentComplete\":\r\n\t\t\tisPercentComplete = true;\r\n\t\t\tvalue = parseFloat(value);\r\n\t\t\tbreak;\r\n\t\tcase \"repeat\":\r\n\t\tcase \"repeatAgain\":\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tif (key[0] !== \"_\") {\r\n\t\t\t\tconst num = parseFloat(value);\r\n\r\n\t\t\t\tif (value === String(num)) {\r\n\t\t\t\t\tvalue = num;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t// deliberate fallthrough\r\n\t\tcase \"queue\":\r\n\t\tcase \"promise\":\r\n\t\tcase \"promiseRejectEmpty\":\r\n\t\tcase \"easing\":\r\n\t\tcase \"started\":\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set a read-only key:`, key);\r\n\r\n\t\t\treturn;\r\n\t}\r\n\tif (value === undefined || value !== value) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set an invalid value:${key}=${value} (${args[1]})`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\tfor (const animation of animations) {\r\n\t\tif (isPercentComplete) {\r\n\t\t\tanimation.timeStart = lastTick - (getValue(animation.duration, animation.options.duration, defaults.duration) * value);\r\n\t\t} else {\r\n\t\t\tanimation[key] = value;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"option\", option], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Pause and resume animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be paused / resumed.\r\n */\r\nfunction checkAnimation(animation: AnimationCall, queueName: false | string, defaultQueue: false | string, isPaused: boolean) {\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (isPaused) {\r\n\t\t\tanimation._flags |= AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t} else {\r\n\t\t\tanimation._flags &= ~AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Pause and Resume are call-wide (not on a per element basis). Thus, calling pause or resume on a\r\n * single element will cause any calls that contain tweens for that element to be paused/resumed\r\n * as well.\r\n */\r\nfunction pauseResume(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string) {\r\n\tconst isPaused = action.indexOf(\"pause\") === 0,\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(args[0]),\r\n\t\tdefaultQueue = defaults.queue;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimation(animation, queueName, defaultQueue, isPaused);\r\n\t\t}\r\n\t} else {\r\n\t\tlet activeCall: AnimationCall = State.first;\r\n\r\n\t\twhile (activeCall) {\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimation(activeCall, queueName, defaultQueue, isPaused);\r\n\t\t\t}\r\n\t\t\tactiveCall = activeCall._next;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"pause\", pauseResume], true);\r\nregisterAction([\"resume\", pauseResume], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerAction} from \"./actions\";\r\n\r\nregisterAction([\"reverse\", (args?: any[], elements?: HTMLorSVGElement[] | VelocityResult, promiseHandler?: VelocityPromise, action?: string) => {\r\n\t// NOTE: Code needs to split out before here - but this is needed to prevent it being overridden\r\n\tthrow new SyntaxError(\"VelocityJS: The 'reverse' action is built in and private.\");\r\n}], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Stop animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be stopped, and if so then set the STOPPED\r\n * flag on it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeStopped(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tanimation._flags |= AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the stop action is triggered, the elements' currently active call is\r\n * immediately stopped. When an element is stopped, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are stopped. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n *\r\n * Note: The stop command runs prior to Velocity's Queueing phase since its\r\n * behavior is intended to take effect *immediately*, regardless of the\r\n * element's current queue state.\r\n */\r\nfunction stop(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise, action?: string): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeStopped(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeStopped(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"stop\", stop], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString, isVelocityResult} from \"../../types\";\r\nimport {fixColors} from \"../css/fixColors\";\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function style(elements: VelocityResult, property: {[property: string]: string}): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string): string | string[];\r\nexport function style(elements: VelocityResult, property: string, value: string): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string | {[property: string]: string}, value?: string) {\r\n\treturn styleAction([property, value], elements);\r\n}\r\n\r\n/**\r\n * Get or set a style of Nomralised property value on one or more elements.\r\n * If there is no value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n *\r\n * This can fail to set, and will reject the Promise if it does so.\r\n *\r\n * Velocity(elements, \"style\", \"property\", \"value\") => elements;\r\n * Velocity(elements, \"style\", {\"property\": \"value\", ...}) => elements;\r\n * Velocity(element, \"style\", \"property\") => \"value\";\r\n * Velocity(elements, \"style\", \"property\") => [\"value\", ...];\r\n */\r\nfunction styleAction(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst property = args[0],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!property) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant property!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// GET\r\n\tif (value === undefined && !isPlainObject(property)) {\r\n\t\t// If only a single animation is found and we're only targetting a\r\n\t\t// single element, then return the value directly\r\n\t\tif (elements.length === 1) {\r\n\t\t\treturn fixColors(getPropertyValue(elements[0], property));\r\n\t\t}\r\n\t\tconst result = [];\r\n\r\n\t\tfor (const element of elements) {\r\n\t\t\tresult.push(fixColors(getPropertyValue(element, property)));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tconst error: string[] = [];\r\n\r\n\tif (isPlainObject(property)) {\r\n\t\tfor (const propertyName in property) {\r\n\t\t\tif (property.hasOwnProperty(propertyName)) {\r\n\t\t\t\tfor (const element of elements) {\r\n\t\t\t\t\tconst propertyValue = property[propertyName];\r\n\r\n\t\t\t\t\tif (isString(propertyValue) || isNumber(propertyValue)) {\r\n\t\t\t\t\t\tsetPropertyValue(element, propertyName, property[propertyName]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\terror.push(`Cannot set a property \"${propertyName}\" to an unknown type: ${typeof propertyValue}`);\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Cannot set a property \"${propertyName}\" to an unknown type:`, propertyValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(value) || isNumber(value)) {\r\n\t\tfor (const element of elements) {\r\n\t\t\tsetPropertyValue(element, property, String(value));\r\n\t\t}\r\n\t} else {\r\n\t\terror.push(`Cannot set a property \"${property}\" to an unknown type: ${typeof value}`);\r\n\t\tconsole.warn(`VelocityJS: Cannot set a property \"${property}\" to an unknown type:`, value);\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (error.length) {\r\n\t\t\tpromiseHandler._rejecter(error.join(\", \"));\r\n\t\t} else if (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"style\", styleAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, HTMLorSVGElement, Properties, Sequence, SequenceList,\r\n\tTweenStep, VelocityEasingType, VelocityPromise, VelocityProperty,\r\n} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {linearEasing} from \"../easing/easings\";\r\nimport {validateEasing} from \"../options\";\r\nimport {expandSequence} from \"../sequences\";\r\nimport {SequencesObject} from \"../sequencesObject\";\r\nimport {expandProperties} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../../constants\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, properties: Properties, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, propertyName: string, property: VelocityProperty, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], ...args: any[]) {\r\n\treturn tweenAction(arguments as any, elements);\r\n}\r\n\r\n/**\r\n *\r\n */\r\nfunction tweenAction(args?: any[], elements?: HTMLorSVGElement[], promiseHandler?: VelocityPromise, action?: string): any {\r\n\tlet requireForcefeeding: boolean;\r\n\r\n\tif (!elements) {\r\n\t\tif (!args.length) {\r\n\t\t\tconsole.info(`Velocity(, \\\"tween\\\", percentComplete, property, end | [end, , ], ) => value\r\nVelocity(, \\\"tween\\\", percentComplete, {property: end | [end, , ], ...}, ) => {property: value, ...}`);\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\telements = [document.body];\r\n\t\trequireForcefeeding = true;\r\n\t} else if (elements.length !== 1) {\r\n\t\t// TODO: Allow more than a single element to return an array of results\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween more than one element!\");\r\n\t}\r\n\tconst percentComplete: number = args[0],\r\n\t\tfakeAnimation = {\r\n\t\t\telements,\r\n\t\t\telement: elements[0],\r\n\t\t\tqueue: false,\r\n\t\t\toptions: {\r\n\t\t\t\tduration: 1000,\r\n\t\t\t},\r\n\t\t\ttweens: null as {[property: string]: Sequence},\r\n\t\t} as any as AnimationCall,\r\n\t\tresult: {[property: string]: string} = {};\r\n\tlet properties: Properties = args[1],\r\n\t\tsingleResult: boolean,\r\n\t\tmaybeSequence: SequenceList,\r\n\t\teasing: VelocityEasingType = args[2],\r\n\t\tcount = 0;\r\n\r\n\tif (isString(args[1])) {\r\n\t\tif (SequencesObject && SequencesObject[args[1]]) {\r\n\t\t\tmaybeSequence = SequencesObject[args[1]];\r\n\t\t\tproperties = {};\r\n\t\t\teasing = args[2];\r\n\t\t} else {\r\n\t\t\tsingleResult = true;\r\n\t\t\tproperties = {\r\n\t\t\t\t[args[1]]: args[2],\r\n\t\t\t};\r\n\t\t\teasing = args[3];\r\n\t\t}\r\n\t} else if (Array.isArray(args[1])) {\r\n\t\tsingleResult = true;\r\n\t\tproperties = {\r\n\t\t\ttween: args[1],\r\n\t\t} as any;\r\n\t\teasing = args[2];\r\n\t}\r\n\tif (!isNumber(percentComplete) || percentComplete < 0 || percentComplete > 1) {\r\n\t\tthrow new Error(\"VelocityJS: Must tween a percentage from 0 to 1!\");\r\n\t}\r\n\tif (!isPlainObject(properties)) {\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween an invalid property!\");\r\n\t}\r\n\tif (requireForcefeeding) {\r\n\t\tfor (const property in properties) {\r\n\t\t\tif (properties.hasOwnProperty(property) && (!Array.isArray(properties[property]) || properties[property].length < 2)) {\r\n\t\t\t\tthrow new Error(\"VelocityJS: When not supplying an element you must force-feed values: \" + property);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst activeEasing = validateEasing(getValue(easing, defaults.easing), DEFAULT_DURATION);\r\n\r\n\tif (maybeSequence) {\r\n\t\texpandSequence(fakeAnimation, maybeSequence);\r\n\t} else {\r\n\t\texpandProperties(fakeAnimation as AnimationCall, properties);\r\n\t}\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const property in fakeAnimation.tweens) {\r\n\t\t// For every element, iterate through each property.\r\n\t\tconst propertyTween = fakeAnimation.tweens[property],\r\n\t\t\tsequence = propertyTween.sequence,\r\n\t\t\tpattern = sequence.pattern;\r\n\t\tlet currentValue = \"\",\r\n\t\t\ti = 0;\r\n\r\n\t\tcount++;\r\n\t\tif (pattern) {\r\n\t\t\tconst easingComplete = (propertyTween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\tlet best = 0;\r\n\r\n\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\tbest = j;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\ttweenEasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\tconst value = tweenEasing(tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(value) : value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresult[property] = currentValue;\r\n\t\t}\r\n\t}\r\n\r\n\tif (singleResult && count === 1) {\r\n\t\tfor (const property in result) {\r\n\t\t\tif (result.hasOwnProperty(property)) {\r\n\t\t\t\treturn result[property];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nregisterAction([\"tween\", tweenAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {ColorNames} from \"./fixColors\";\r\n\r\n/**\r\n * Converting from hex as it makes for a smaller file.\r\n */\r\nconst colorValues = {\r\n\taliceblue: 0xF0F8FF,\r\n\tantiquewhite: 0xFAEBD7,\r\n\taqua: 0x00FFFF,\r\n\taquamarine: 0x7FFFD4,\r\n\tazure: 0xF0FFFF,\r\n\tbeige: 0xF5F5DC,\r\n\tbisque: 0xFFE4C4,\r\n\tblack: 0x000000,\r\n\tblanchedalmond: 0xFFEBCD,\r\n\tblue: 0x0000FF,\r\n\tblueviolet: 0x8A2BE2,\r\n\tbrown: 0xA52A2A,\r\n\tburlywood: 0xDEB887,\r\n\tcadetblue: 0x5F9EA0,\r\n\tchartreuse: 0x7FFF00,\r\n\tchocolate: 0xD2691E,\r\n\tcoral: 0xFF7F50,\r\n\tcornflowerblue: 0x6495ED,\r\n\tcornsilk: 0xFFF8DC,\r\n\tcrimson: 0xDC143C,\r\n\tcyan: 0x00FFFF,\r\n\tdarkblue: 0x00008B,\r\n\tdarkcyan: 0x008B8B,\r\n\tdarkgoldenrod: 0xB8860B,\r\n\tdarkgray: 0xA9A9A9,\r\n\tdarkgrey: 0xA9A9A9,\r\n\tdarkgreen: 0x006400,\r\n\tdarkkhaki: 0xBDB76B,\r\n\tdarkmagenta: 0x8B008B,\r\n\tdarkolivegreen: 0x556B2F,\r\n\tdarkorange: 0xFF8C00,\r\n\tdarkorchid: 0x9932CC,\r\n\tdarkred: 0x8B0000,\r\n\tdarksalmon: 0xE9967A,\r\n\tdarkseagreen: 0x8FBC8F,\r\n\tdarkslateblue: 0x483D8B,\r\n\tdarkslategray: 0x2F4F4F,\r\n\tdarkslategrey: 0x2F4F4F,\r\n\tdarkturquoise: 0x00CED1,\r\n\tdarkviolet: 0x9400D3,\r\n\tdeeppink: 0xFF1493,\r\n\tdeepskyblue: 0x00BFFF,\r\n\tdimgray: 0x696969,\r\n\tdimgrey: 0x696969,\r\n\tdodgerblue: 0x1E90FF,\r\n\tfirebrick: 0xB22222,\r\n\tfloralwhite: 0xFFFAF0,\r\n\tforestgreen: 0x228B22,\r\n\tfuchsia: 0xFF00FF,\r\n\tgainsboro: 0xDCDCDC,\r\n\tghostwhite: 0xF8F8FF,\r\n\tgold: 0xFFD700,\r\n\tgoldenrod: 0xDAA520,\r\n\tgray: 0x808080,\r\n\tgrey: 0x808080,\r\n\tgreen: 0x008000,\r\n\tgreenyellow: 0xADFF2F,\r\n\thoneydew: 0xF0FFF0,\r\n\thotpink: 0xFF69B4,\r\n\tindianred: 0xCD5C5C,\r\n\tindigo: 0x4B0082,\r\n\tivory: 0xFFFFF0,\r\n\tkhaki: 0xF0E68C,\r\n\tlavender: 0xE6E6FA,\r\n\tlavenderblush: 0xFFF0F5,\r\n\tlawngreen: 0x7CFC00,\r\n\tlemonchiffon: 0xFFFACD,\r\n\tlightblue: 0xADD8E6,\r\n\tlightcoral: 0xF08080,\r\n\tlightcyan: 0xE0FFFF,\r\n\tlightgoldenrodyellow: 0xFAFAD2,\r\n\tlightgray: 0xD3D3D3,\r\n\tlightgrey: 0xD3D3D3,\r\n\tlightgreen: 0x90EE90,\r\n\tlightpink: 0xFFB6C1,\r\n\tlightsalmon: 0xFFA07A,\r\n\tlightseagreen: 0x20B2AA,\r\n\tlightskyblue: 0x87CEFA,\r\n\tlightslategray: 0x778899,\r\n\tlightslategrey: 0x778899,\r\n\tlightsteelblue: 0xB0C4DE,\r\n\tlightyellow: 0xFFFFE0,\r\n\tlime: 0x00FF00,\r\n\tlimegreen: 0x32CD32,\r\n\tlinen: 0xFAF0E6,\r\n\tmagenta: 0xFF00FF,\r\n\tmaroon: 0x800000,\r\n\tmediumaquamarine: 0x66CDAA,\r\n\tmediumblue: 0x0000CD,\r\n\tmediumorchid: 0xBA55D3,\r\n\tmediumpurple: 0x9370DB,\r\n\tmediumseagreen: 0x3CB371,\r\n\tmediumslateblue: 0x7B68EE,\r\n\tmediumspringgreen: 0x00FA9A,\r\n\tmediumturquoise: 0x48D1CC,\r\n\tmediumvioletred: 0xC71585,\r\n\tmidnightblue: 0x191970,\r\n\tmintcream: 0xF5FFFA,\r\n\tmistyrose: 0xFFE4E1,\r\n\tmoccasin: 0xFFE4B5,\r\n\tnavajowhite: 0xFFDEAD,\r\n\tnavy: 0x000080,\r\n\toldlace: 0xFDF5E6,\r\n\tolive: 0x808000,\r\n\tolivedrab: 0x6B8E23,\r\n\torange: 0xFFA500,\r\n\torangered: 0xFF4500,\r\n\torchid: 0xDA70D6,\r\n\tpalegoldenrod: 0xEEE8AA,\r\n\tpalegreen: 0x98FB98,\r\n\tpaleturquoise: 0xAFEEEE,\r\n\tpalevioletred: 0xDB7093,\r\n\tpapayawhip: 0xFFEFD5,\r\n\tpeachpuff: 0xFFDAB9,\r\n\tperu: 0xCD853F,\r\n\tpink: 0xFFC0CB,\r\n\tplum: 0xDDA0DD,\r\n\tpowderblue: 0xB0E0E6,\r\n\tpurple: 0x800080,\r\n\trebeccapurple: 0x663399,\r\n\tred: 0xFF0000,\r\n\trosybrown: 0xBC8F8F,\r\n\troyalblue: 0x4169E1,\r\n\tsaddlebrown: 0x8B4513,\r\n\tsalmon: 0xFA8072,\r\n\tsandybrown: 0xF4A460,\r\n\tseagreen: 0x2E8B57,\r\n\tseashell: 0xFFF5EE,\r\n\tsienna: 0xA0522D,\r\n\tsilver: 0xC0C0C0,\r\n\tskyblue: 0x87CEEB,\r\n\tslateblue: 0x6A5ACD,\r\n\tslategray: 0x708090,\r\n\tslategrey: 0x708090,\r\n\tsnow: 0xFFFAFA,\r\n\tspringgreen: 0x00FF7F,\r\n\tsteelblue: 0x4682B4,\r\n\ttan: 0xD2B48C,\r\n\tteal: 0x008080,\r\n\tthistle: 0xD8BFD8,\r\n\ttomato: 0xFF6347,\r\n\tturquoise: 0x40E0D0,\r\n\tviolet: 0xEE82EE,\r\n\twheat: 0xF5DEB3,\r\n\twhite: 0xFFFFFF,\r\n\twhitesmoke: 0xF5F5F5,\r\n\tyellow: 0xFFFF00,\r\n\tyellowgreen: 0x9ACD32,\r\n};\r\n\r\nfor (const name in colorValues) {\r\n\tif (colorValues.hasOwnProperty(name)) {\r\n\t\tconst color = colorValues[name];\r\n\r\n\t\tColorNames[name] = `${Math.floor(color / 65536)},${Math.floor(color / 256 % 256)},${(color % 256)}`;\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Back easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nexport function registerBackIn(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackOut(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (Math.pow(--percentComplete, 2) * ((amount + 1) * percentComplete + amount) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackInOut(name: string, amount: number) {\r\n\tamount *= 1.525;\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tpercentComplete *= 2;\r\n\r\n\t\treturn (percentComplete < 1\r\n\t\t\t? (Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount))\r\n\t\t\t: (Math.pow(percentComplete - 2, 2) * ((amount + 1) * (percentComplete - 2) + amount) + 2)\r\n\t\t) * 0.5 * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterBackIn(\"easeInBack\", 1.7);\r\nregisterBackOut(\"easeOutBack\", 1.7);\r\nregisterBackInOut(\"easeInOutBack\", 1.7);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bounce easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nfunction easeOutBouncePercent(percentComplete: number): number {\r\n\tif (percentComplete < 1 / 2.75) {\r\n\t\treturn (7.5625 * percentComplete * percentComplete);\r\n\t}\r\n\tif (percentComplete < 2 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 1.5 / 2.75) * percentComplete + 0.75);\r\n\t}\r\n\tif (percentComplete < 2.5 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 2.25 / 2.75) * percentComplete + 0.9375);\r\n\t}\r\n\r\n\treturn (7.5625 * (percentComplete -= 2.625 / 2.75) * percentComplete + 0.984375);\r\n}\r\n\r\nfunction easeInBouncePercent(percentComplete: number): number {\r\n\treturn 1 - easeOutBouncePercent(1 - percentComplete);\r\n}\r\n\r\nexport function easeInBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeInBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeOutBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeInOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn (percentComplete < 0.5\r\n\t\t? easeInBouncePercent(percentComplete * 2) * 0.5\r\n\t\t: easeOutBouncePercent(percentComplete * 2 - 1) * 0.5 + 0.5\r\n\t) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"easeInBounce\", easeInBounce]);\r\nregisterEasing([\"easeOutBounce\", easeOutBounce]);\r\nregisterEasing([\"easeInOutBounce\", easeInOutBounce]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Elastic easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n// Constants\r\nconst PI2 = Math.PI * 2;\r\n\r\nexport function registerElasticIn(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn -(amplitude * Math.pow(2, 10 * (percentComplete -= 1)) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period)) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticInOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tconst s = period / PI2 * Math.asin(1 / amplitude);\r\n\r\n\t\tpercentComplete = percentComplete * 2 - 1;\r\n\r\n\t\treturn (percentComplete < 0\r\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period))\r\n\t\t\t: amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period) * 0.5 + 1\r\n\t\t) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterElasticIn(\"easeInElastic\", 1, 0.3);\r\nregisterElasticOut(\"easeOutElastic\", 1, 0.3);\r\nregisterElasticInOut(\"easeInOutElastic\", 1, 0.3 * 1.5);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Easings to act on strings, either set at the start or at the end depending on\r\n * need.\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Easing function that sets to the specified value immediately after the\r\n * animation starts.\r\n */\r\nexport function atStart(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value while the animation is\r\n * running.\r\n */\r\nexport function during(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0 || percentComplete === 1\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value when the animation ends.\r\n */\r\nexport function atEnd(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 1\r\n\t\t? endValue\r\n\t\t: startValue;\r\n}\r\n\r\nregisterEasing([\"at-start\", atStart]);\r\nregisterEasing([\"during\", during]);\r\nregisterEasing([\"at-end\", atEnd]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {augmentDimension} from \"../css/augmentDimension\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get/set the inner/outer dimension.\r\n */\r\nfunction getDimension(name: \"width\" | \"height\", wantInner: boolean) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn augmentDimension(element, name, wantInner) + \"px\";\r\n\t\t}\r\n\t\tsetPropertyValue(element, name, (parseFloat(propertyValue) - augmentDimension(element, name, wantInner)) + \"px\");\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"innerWidth\", getDimension(\"width\", true)]);\r\nregisterNormalization([\"Element\", \"innerHeight\", getDimension(\"height\", true)]);\r\nregisterNormalization([\"Element\", \"outerWidth\", getDimension(\"width\", false)]);\r\nregisterNormalization([\"Element\", \"outerHeight\", getDimension(\"height\", false)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {Data} from \"../data\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n// Constants\r\nexport const inlineRx = /^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|let|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i,\r\n\tlistItemRx = /^(li)$/i,\r\n\ttableRowRx = /^(tr)$/i,\r\n\ttableRx = /^(table)$/i,\r\n\ttableRowGroupRx = /^(tbody)$/i;\r\n\r\n/**\r\n * Display has an extra value of \"auto\" that works out the correct value\r\n * based on the type of element.\r\n */\r\nfunction display(element: HTMLorSVGElement): string;\r\nfunction display(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction display(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tconst style = element.style;\r\n\r\n\tif (propertyValue === undefined) {\r\n\t\treturn computePropertyValue(element, \"display\");\r\n\t}\r\n\tif (propertyValue === \"auto\") {\r\n\t\tconst nodeName = element && element.nodeName,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (inlineRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"inline\";\r\n\t\t} else if (listItemRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"list-item\";\r\n\t\t} else if (tableRowRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row\";\r\n\t\t} else if (tableRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table\";\r\n\t\t} else if (tableRowGroupRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row-group\";\r\n\t\t} else {\r\n\t\t\t// Default to \"block\" when no match is found.\r\n\t\t\tpropertyValue = \"block\";\r\n\t\t}\r\n\t\t// IMPORTANT: We need to do this as getPropertyValue bypasses the\r\n\t\t// Normalisation when it exists in the cache.\r\n\t\tdata.cache[\"display\"] = propertyValue;\r\n\t}\r\n\tstyle.display = propertyValue;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"display\", display]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction clientWidth(element: HTMLorSVGElement): string;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction scrollWidth(element: HTMLorSVGElement): string;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction clientHeight(element: HTMLorSVGElement): string;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction scrollHeight(element: HTMLorSVGElement): string;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Scroll an element.\r\n */\r\nfunction scroll(direction: \"Height\", end: \"Top\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Width\", end: \"Left\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Height\" | \"Width\", end: \"Top\" | \"Left\"): VelocityNormalizationsFn {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue == null) {\r\n\t\t\t// Make sure we have these values cached.\r\n\t\t\tgetPropertyValue(element, \"client\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + end, null, true);\r\n\r\n\t\t\treturn element[\"scroll\" + end] + \"px\";\r\n\t\t}\r\n\t\tconst value = parseFloat(propertyValue),\r\n\t\t\tunit = propertyValue.replace(String(value), \"\");\r\n\r\n\t\tswitch (unit) {\r\n\t\t\tcase \"\":\r\n\t\t\tcase \"px\":\r\n\t\t\t\telement[\"scroll\" + end] = value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"%\":\r\n\t\t\t\tconst client = parseFloat(getPropertyValue(element, \"client\" + direction)),\r\n\t\t\t\t\tscrollValue = parseFloat(getPropertyValue(element, \"scroll\" + direction));\r\n\r\n\t\t\t\telement[\"scroll\" + end] = Math.max(0, scrollValue - client) * value / 100;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"HTMLElement\", \"scroll\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollTop\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollLeft\", scroll(\"Width\", \"Left\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollWidth\", scrollWidth]);\r\nregisterNormalization([\"HTMLElement\", \"clientWidth\", clientWidth]);\r\nregisterNormalization([\"HTMLElement\", \"scrollHeight\", scrollHeight]);\r\nregisterNormalization([\"HTMLElement\", \"clientHeight\", clientHeight]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * This handles all CSS style properties. With browser prefixed properties it\r\n * will register a version that handles setting (and getting) both the prefixed\r\n * and non-prefixed version.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {ALL_VENDOR_PREFIXES} from \"../../constants\";\r\nimport {isString} from \"../../types\";\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {State} from \"../state\";\r\nimport {hasNormalization, registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * An RegExp pattern for the following list of css words using\r\n * http://kemio.com.ar/tools/lst-trie-re.php to generate:\r\n *\r\n * blockSize\r\n * borderBottomLeftRadius\r\n * borderBottomRightRadius\r\n * borderBottomWidth\r\n * borderImageOutset\r\n * borderImageWidth\r\n * borderLeftWidth\r\n * borderRadius\r\n * borderRightWidth\r\n * borderSpacing\r\n * borderTopLeftRadius\r\n * borderTopRightRadius\r\n * borderTopWidth\r\n * borderWidth\r\n * bottom\r\n * columnGap\r\n * columnRuleWidth\r\n * columnWidth\r\n * flexBasis\r\n * fontSize\r\n * gridColumnGap\r\n * gridGap\r\n * gridRowGap\r\n * height\r\n * inlineSize\r\n * left\r\n * letterSpacing\r\n * margin\r\n * marginBottom\r\n * marginLeft\r\n * marginRight\r\n * marginTop\r\n * maxBlockSize\r\n * maxHeight\r\n * maxInlineSize\r\n * maxWidth\r\n * minBlockSize\r\n * minHeight\r\n * minInlineSize\r\n * minWidth\r\n * objectPosition\r\n * outlineOffset\r\n * outlineWidth\r\n * padding\r\n * paddingBottom\r\n * paddingLeft\r\n * paddingRight\r\n * paddingTop\r\n * perspective\r\n * right\r\n * shapeMargin\r\n * strokeDashoffset\r\n * strokeWidth\r\n * textIndent\r\n * top\r\n * transformOrigin\r\n * width\r\n * wordSpacing\r\n */\r\n// tslint:disable-next-line:max-line-length\r\nconst rxAddPx = /^(b(lockSize|o(rder(Bottom(LeftRadius|RightRadius|Width)|Image(Outset|Width)|LeftWidth|R(adius|ightWidth)|Spacing|Top(LeftRadius|RightRadius|Width)|Width)|ttom))|column(Gap|RuleWidth|Width)|f(lexBasis|ontSize)|grid(ColumnGap|Gap|RowGap)|height|inlineSize|le(ft|tterSpacing)|m(a(rgin(Bottom|Left|Right|Top)|x(BlockSize|Height|InlineSize|Width))|in(BlockSize|Height|InlineSize|Width))|o(bjectPosition|utline(Offset|Width))|p(adding(Bottom|Left|Right|Top)|erspective)|right|s(hapeMargin|troke(Dashoffset|Width))|t(extIndent|op|ransformOrigin)|w(idth|ordSpacing))$/;\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a prefixed style\r\n * property.\r\n */\r\nfunction getSetPrefixed(propertyName: string, unprefixed: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName) || computePropertyValue(element, unprefixed);\r\n\t\t}\r\n\t\telement.style[propertyName] = element.style[unprefixed] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a style property.\r\n */\r\nfunction getSetStyle(propertyName: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName);\r\n\t\t}\r\n\t\telement.style[propertyName] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Vendor prefixes. Chrome / Safari, Firefox, IE / Edge, Opera.\r\n */\r\nconst rxVendors = /^(webkit|moz|ms|o)[A-Z]/,\r\n\tprefixElement = State.prefixElement;\r\n\r\nfor (const propertyName in prefixElement.style) {\r\n\tif (rxVendors.test(propertyName)) {\r\n\t\tconst unprefixed = propertyName.replace(/^[a-z]+([A-Z])/, ($, letter: string) => letter.toLowerCase());\r\n\r\n\t\tif (ALL_VENDOR_PREFIXES || isString(prefixElement.style[unprefixed])) {\r\n\t\t\tconst addUnit = rxAddPx.test(unprefixed) ? \"px\" : undefined;\r\n\r\n\t\t\tregisterNormalization([\"Element\", unprefixed, getSetPrefixed(propertyName, unprefixed), addUnit]);\r\n\t\t}\r\n\t} else if (!hasNormalization([\"Element\", propertyName])) {\r\n\t\tconst addUnit = rxAddPx.test(propertyName) ? \"px\" : undefined;\r\n\r\n\t\tregisterNormalization([\"Element\", propertyName, getSetStyle(propertyName), addUnit]);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../../types\";\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set an attribute.\r\n */\r\nfunction getAttribute(name: string) {\r\n\treturn ((element: Element, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn element.getAttribute(name);\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nconst base = document.createElement(\"div\"),\r\n\trxSubtype = /^SVG(.*)Element$/,\r\n\trxElement = /Element$/;\r\n\r\nObject.getOwnPropertyNames(window)\r\n\t.forEach((property) => {\r\n\t\tconst subtype = rxSubtype.exec(property);\r\n\r\n\t\tif (subtype && subtype[1] !== \"SVG\") { // Don't do SVGSVGElement.\r\n\t\t\ttry {\r\n\t\t\t\tconst element = subtype[1] ? document.createElementNS(\"http://www.w3.org/2000/svg\", (subtype[1] || \"svg\").toLowerCase()) : document.createElement(\"svg\");\r\n\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const attribute in element) {\r\n\t\t\t\t\t// Although this isn't a tween without prototypes, we do\r\n\t\t\t\t\t// want to get hold of all attributes and not just own ones.\r\n\t\t\t\t\tconst value = element[attribute];\r\n\r\n\t\t\t\t\tif (isString(attribute)\r\n\t\t\t\t\t\t&& !(attribute[0] === \"o\" && attribute[1] === \"n\")\r\n\t\t\t\t\t\t&& attribute !== attribute.toUpperCase()\r\n\t\t\t\t\t\t&& !rxElement.test(attribute)\r\n\t\t\t\t\t\t&& !(attribute in base)\r\n\t\t\t\t\t\t&& !isFunction(value)) {\r\n\t\t\t\t\t\t// TODO: Should this all be set on the generic SVGElement, it would save space and time, but not as powerful\r\n\t\t\t\t\t\tregisterNormalization([property, attribute, getAttribute(attribute)]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.error(`VelocityJS: Error when trying to identify SVG attributes on ${property}.`, e);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set the width or height.\r\n */\r\nfunction getDimension(name: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\t// Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM.\r\n\t\t\ttry {\r\n\t\t\t\treturn (element as SVGGraphicsElement).getBBox()[name] + \"px\";\r\n\t\t\t} catch (e) {\r\n\t\t\t\treturn \"0px\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"SVGElement\", \"width\", getDimension(\"width\")]);\r\nregisterNormalization([\"SVGElement\", \"height\", getDimension(\"height\")]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * A fake normalization used to allow the \"tween\" property easy access.\r\n */\r\nfunction getSetTween(element: HTMLorSVGElement, propertyValue?: string) {\r\n\tif (propertyValue === undefined) {\r\n\t\treturn \"\";\r\n\t}\r\n}\r\n\r\nregisterNormalization([\"Element\", \"tween\", getSetTween]);\r\n","/*\n * velocity-animate (C) 2014-2017 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Automatically generated\nexport const VERSION = \"2.0.3\";\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, SequenceList, VelocitySequence, VelocityTween} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../types\";\r\nimport Velocity from \"../velocity\";\r\nimport {registerAction} from \"./actions/actions\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {getNormalization} from \"./normalizations/normalizations\";\r\nimport {validateDuration, validateEasing} from \"./options\";\r\nimport {SequencesObject} from \"./sequencesObject\";\r\nimport {findPattern} from \"./tweens\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../constants\";\r\n\r\nconst rxPercents = /(\\d*\\.\\d+|\\d+\\.?|from|to)/g;\r\n\r\nexport function expandSequence(animation: AnimationCall, sequence: SequenceList) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telement = animation.element;\r\n\r\n\tfor (const propertyName in sequence.tweens) {\r\n\t\tif (sequence.tweens.hasOwnProperty(propertyName)) {\r\n\t\t\tconst fn = getNormalization(element, propertyName);\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping [${propertyName}] due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttweens[propertyName] = {\r\n\t\t\t\tfn,\r\n\t\t\t\tsequence: sequence.tweens[propertyName],\r\n\t\t\t} as VelocityTween;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to register a sequence. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerSequence\", \"\"name\", VelocitySequence);\r\n */\r\nexport function registerSequence(args?: [string, VelocitySequence] | [{[name: string]: VelocitySequence}]) {\r\n\tif (isPlainObject(args[0])) {\r\n\t\tfor (const name in (args[0] as {[name: string]: VelocitySequence})) {\r\n\t\t\tif (args[0].hasOwnProperty(name)) {\r\n\t\t\t\tregisterSequence([name, args[0][name]]);\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(args[0])) {\r\n\t\tconst name = args[0] as string,\r\n\t\t\tsequence = args[1] as VelocitySequence;\r\n\r\n\t\tif (!isString(name)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' name to an invalid value:`, name);\r\n\t\t} else if (!isPlainObject(sequence)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' sequence to an invalid value:`, name, sequence);\r\n\t\t} else {\r\n\t\t\tif (SequencesObject[name]) {\r\n\t\t\t\tconsole.warn(`VelocityJS: Replacing named sequence:`, name);\r\n\t\t\t}\r\n\t\t\tconst percents: {[key: string]: string[]} = {},\r\n\t\t\t\tsteps: string[] = new Array(100),\r\n\t\t\t\tproperties: string[] = [],\r\n\t\t\t\tpercentages: string[] = [],\r\n\t\t\t\tsequenceList: SequenceList = SequencesObject[name] = {} as any,\r\n\t\t\t\tduration = validateDuration((sequence as any).duration);\r\n\r\n\t\t\tsequenceList.tweens = {};\r\n\t\t\tif (isNumber(duration)) {\r\n\t\t\t\tsequenceList.duration = duration;\r\n\t\t\t}\r\n\t\t\tfor (const part in sequence) {\r\n\t\t\t\tif (sequence.hasOwnProperty(part)) {\r\n\t\t\t\t\tconst keys = String(part)\r\n\t\t\t\t\t\t.match(rxPercents);\r\n\r\n\t\t\t\t\tif (keys) {\r\n\t\t\t\t\t\tpercentages.push(part);\r\n\t\t\t\t\t\tfor (const key of keys) {\r\n\t\t\t\t\t\t\tconst percent = key === \"from\"\r\n\t\t\t\t\t\t\t\t? 0\r\n\t\t\t\t\t\t\t\t: key === \"to\"\r\n\t\t\t\t\t\t\t\t\t? 100\r\n\t\t\t\t\t\t\t\t\t: parseFloat(key);\r\n\r\n\t\t\t\t\t\t\tif (percent < 0 || percent > 100) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid value as a percentage (0 <= n <= 100):`, name, percent);\r\n\t\t\t\t\t\t\t} else if (isNaN(percent)) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid number as a percentage:`, name, part, key);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (!percents[String(percent)]) {\r\n\t\t\t\t\t\t\t\t\tpercents[String(percent)] = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tpercents[String(percent)].push(part);\r\n\t\t\t\t\t\t\t\tfor (const property in sequence[part]) {\r\n\t\t\t\t\t\t\t\t\tif (!properties.includes(property)) {\r\n\t\t\t\t\t\t\t\t\t\tproperties.push(property);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst orderedPercents = Object.keys(percents)\r\n\t\t\t\t.sort((a, b) => {\r\n\t\t\t\t\tconst a1 = parseFloat(a),\r\n\t\t\t\t\t\tb1 = parseFloat(b);\r\n\r\n\t\t\t\t\treturn a1 > b1 ? 1 : a1 < b1 ? -1 : 0;\r\n\t\t\t\t});\r\n\r\n\t\t\torderedPercents.forEach((key) => {\r\n\t\t\t\tsteps.push.apply(percents[key]);\r\n\t\t\t});\r\n\t\t\tfor (const property of properties) {\r\n\t\t\t\tconst parts: string[] = [],\r\n\t\t\t\t\tpropertyName = camelCase(property);\r\n\r\n\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\tconst stepProperties = sequence[value];\r\n\r\n\t\t\t\t\t\tif (stepProperties[propertyName]) {\r\n\t\t\t\t\t\t\tparts.push(isString(stepProperties[propertyName])\r\n\t\t\t\t\t\t\t\t? stepProperties[propertyName]\r\n\t\t\t\t\t\t\t\t: stepProperties[propertyName][0]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (parts.length) {\r\n\t\t\t\t\tconst realSequence = findPattern(parts, propertyName);\r\n\t\t\t\t\tlet index = 0;\r\n\r\n\t\t\t\t\tif (realSequence) {\r\n\t\t\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\t\t\tconst originalProperty = sequence[value][propertyName];\r\n\r\n\t\t\t\t\t\t\t\tif (originalProperty) {\r\n\t\t\t\t\t\t\t\t\tif (Array.isArray(originalProperty) && originalProperty.length > 1 && (isString(originalProperty[1]) || Array.isArray(originalProperty[1]))) {\r\n\t\t\t\t\t\t\t\t\t\trealSequence[index].easing = validateEasing(originalProperty[1], sequenceList.duration || DEFAULT_DURATION);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\trealSequence[index++].percent = parseFloat(key) / 100;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsequenceList.tweens[propertyName] = realSequence;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerSequence\", registerSequence], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Core \"Velocity\" function.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, StrictVelocityOptions,\r\n\tVelocityElements, VelocityObjectArgs, VelocityOptions, VelocityPromise, VelocityProperty,\r\n\tVelocityResult,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean, isFunction, isNode, isPlainObject, isString, isVelocityResult, isWrapped} from \"./types\";\r\nimport {cloneArray, defineProperty, getValue} from \"./utility\";\r\nimport {Data} from \"./Velocity/data\";\r\nimport {\r\n\tvalidateBegin, validateComplete, validateDelay, validateDuration, validateEasing,\r\n\tvalidateLoop, validateProgress, validateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./Velocity/options\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {queue} from \"./Velocity/queue\";\r\nimport {expandSequence} from \"./Velocity/sequences\";\r\nimport {tick} from \"./Velocity/tick\";\r\nimport {expandProperties} from \"./Velocity/tweens\";\r\n\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\n\r\n/* tslint:disable:max-line-length */\r\n/**\r\n * The main Velocity function. Acts as a gateway to everything else.\r\n */\r\nexport function Velocity(options: VelocityObjectArgs): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, options?: VelocityOptions): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\n/* tslint:enable:max-line-length */\r\nexport function Velocity(this: VelocityElements | void, ...argsList: any[]): VelocityResult {\r\n\tconst\r\n\t\t/**\r\n\t\t * A shortcut to the default options.\r\n\t\t */\r\n\t\tdefaults = DefaultObject,\r\n\t\t/**\r\n\t\t * Shortcut to arguments for file size.\r\n\t\t */\r\n\t\targs = arguments,\r\n\t\t/**\r\n\t\t * Cache of the first argument - this is used often enough to be saved.\r\n\t\t */\r\n\t\targs0 = args[0] as VelocityObjectArgs,\r\n\t\t/**\r\n\t\t * To allow for expressive CoffeeScript code, Velocity supports an\r\n\t\t * alternative syntax in which \"elements\" (or \"e\"), \"properties\" (or\r\n\t\t * \"p\"), and \"options\" (or \"o\") objects are defined on a container\r\n\t\t * object that's passed in as Velocity's sole argument.\r\n\t\t *\r\n\t\t * Note: Some browsers automatically populate arguments with a\r\n\t\t * \"properties\" object. We detect it by checking for its default\r\n\t\t * \"names\" property.\r\n\t\t */\r\n\t\t// TODO: Confirm which browsers - if <=IE8 the we can drop completely\r\n\t\tsyntacticSugar = isPlainObject(args0) && (args0.p || ((isPlainObject(args0.properties) && !(args0.properties as any).names) || isString(args0.properties)));\r\n\tlet\r\n\t\t/**\r\n\t\t * When Velocity is called via the utility function (Velocity()),\r\n\t\t * elements are explicitly passed in as the first parameter. Thus,\r\n\t\t * argument positioning varies.\r\n\t\t */\r\n\t\targumentIndex: number = 0,\r\n\t\t/**\r\n\t\t * The list of elements, extended with Promise and Velocity.\r\n\t\t */\r\n\t\telements: VelocityResult,\r\n\t\t/**\r\n\t\t * The properties being animated. This can be a string, in which case it\r\n\t\t * is either a function for these elements, or it is a \"named\" animation\r\n\t\t * sequence to use instead. Named sequences start with either \"callout.\"\r\n\t\t * or \"transition.\". When used as a callout the values will be reset\r\n\t\t * after finishing. When used as a transtition then there is no special\r\n\t\t * handling after finishing.\r\n\t\t */\r\n\t\tpropertiesMap: string | Properties,\r\n\t\t/**\r\n\t\t * Options supplied, this will be mapped and validated into\r\n\t\t * options.\r\n\t\t */\r\n\t\toptionsMap: VelocityOptions,\r\n\t\t/**\r\n\t\t * If called via a chain then this contains the last calls\r\n\t\t * animations. If this does not have a value then any access to the\r\n\t\t * element's animations needs to be to the currently-running ones.\r\n\t\t */\r\n\t\tanimations: AnimationCall[],\r\n\t\t/**\r\n\t\t * The promise that is returned.\r\n\t\t */\r\n\t\tpromise: Promise,\r\n\t\t// Used when the animation is finished\r\n\t\tresolver: (value?: VelocityResult) => void,\r\n\t\t// Used when there was an issue with one or more of the Velocity arguments\r\n\t\trejecter: (reason: any) => void;\r\n\r\n\t//console.log(`Velocity`, _arguments)\r\n\t// First get the elements, and the animations connected to the last call if\r\n\t// this is chained.\r\n\t// TODO: Clean this up a bit\r\n\t// TODO: Throw error if the chain is called with elements as the first argument. isVelocityResult(this) && ( (isNode(arg0) || isWrapped(arg0)) && arg0 == this)\r\n\tif (isNode(this)) {\r\n\t\t// This is from a chain such as document.getElementById(\"\").velocity(...)\r\n\t\telements = [this as HTMLorSVGElement] as VelocityResult;\r\n\t} else if (isWrapped(this)) {\r\n\t\t// This might be a chain from something else, but if chained from a\r\n\t\t// previous Velocity() call then grab the animations it's related to.\r\n\t\telements = cloneArray(this as HTMLorSVGElement[]) as VelocityResult;\r\n\t\tif (isVelocityResult(this)) {\r\n\t\t\tanimations = (this as VelocityResult).velocity.animations;\r\n\t\t}\r\n\t} else if (syntacticSugar) {\r\n\t\telements = cloneArray(args0.elements || args0.e) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isNode(args0)) {\r\n\t\telements = cloneArray([args0]) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isWrapped(args0)) {\r\n\t\telements = cloneArray(args0) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t}\r\n\t// Allow elements to be chained.\r\n\tif (elements) {\r\n\t\tdefineProperty(elements, \"velocity\", Velocity.bind(elements));\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t// Next get the propertiesMap and options.\r\n\tif (syntacticSugar) {\r\n\t\tpropertiesMap = getValue(args0.properties, args0.p);\r\n\t} else {\r\n\t\t// TODO: Should be possible to call Velocity(\"pauseAll\") - currently not possible\r\n\t\tpropertiesMap = args[argumentIndex++] as string | Properties;\r\n\t}\r\n\t// Get any options map passed in as arguments first, expand any direct\r\n\t// options if possible.\r\n\tconst isReverse = propertiesMap === \"reverse\",\r\n\t\tisAction = !isReverse && isString(propertiesMap),\r\n\t\tmaybeSequence = isAction && SequencesObject[propertiesMap as string],\r\n\t\topts = syntacticSugar ? getValue(args0.options, args0.o) : args[argumentIndex];\r\n\r\n\tif (isPlainObject(opts)) {\r\n\t\toptionsMap = opts;\r\n\t}\r\n\t// Create the promise if supported and wanted.\r\n\tif (Promise && getValue(optionsMap && optionsMap.promise, defaults.promise)) {\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\trejecter = reject;\r\n\t\t\t// IMPORTANT:\r\n\t\t\t// If a resolver tries to run on a Promise then it will wait until\r\n\t\t\t// that Promise resolves - but in this case we're running on our own\r\n\t\t\t// Promise, so need to make sure it's not seen as one. Setting these\r\n\t\t\t// values to undefined for the duration of the resolve.\r\n\t\t\t// Due to being an async call, they should be back to \"normal\"\r\n\t\t\t// before the .then() function gets called.\r\n\t\t\tresolver = (result: VelocityResult) => {\r\n\t\t\t\tif (isVelocityResult(result)) {\r\n\t\t\t\t\tconst then = result && result.then;\r\n\r\n\t\t\t\t\tif (then) {\r\n\t\t\t\t\t\tresult.then = undefined; // Preserving enumeration etc\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t\tif (then) {\r\n\t\t\t\t\t\tresult.then = then;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t});\r\n\t\tif (elements) {\r\n\t\t\tdefineProperty(elements, \"then\", promise.then.bind(promise));\r\n\t\t\tdefineProperty(elements, \"catch\", promise.catch.bind(promise));\r\n\t\t\tif ((promise as any).finally) {\r\n\t\t\t\t// Semi-standard\r\n\t\t\t\tdefineProperty(elements, \"finally\", (promise as any).finally.bind(promise));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst promiseRejectEmpty: boolean = getValue(optionsMap && optionsMap.promiseRejectEmpty, defaults.promiseRejectEmpty);\r\n\r\n\tif (promise) {\r\n\t\tif (!elements && !isAction) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No elements supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t} else if (!propertiesMap) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No properties supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ((!elements && !isAction) || !propertiesMap) {\r\n\t\treturn promise as any;\r\n\t}\r\n\r\n\t// NOTE: Can't use isAction here due to type inference - there are callbacks\r\n\t// between so the type isn't considered safe.\r\n\tif (isAction) {\r\n\t\tconst actionArgs: any[] = [],\r\n\t\t\tpromiseHandler: VelocityPromise = promise && {\r\n\t\t\t\t_promise: promise,\r\n\t\t\t\t_resolver: resolver,\r\n\t\t\t\t_rejecter: rejecter,\r\n\t\t\t};\r\n\r\n\t\twhile (argumentIndex < args.length) {\r\n\t\t\tactionArgs.push(args[argumentIndex++]);\r\n\t\t}\r\n\r\n\t\t// Velocity's behavior is categorized into \"actions\". If a string is\r\n\t\t// passed in instead of a propertiesMap then that will call a function\r\n\t\t// to do something special to the animation linked.\r\n\t\t// There is one special case - \"reverse\" - which is handled differently,\r\n\t\t// by being stored on the animation and then expanded when the animation\r\n\t\t// starts.\r\n\t\tconst action = (propertiesMap as string).replace(/\\..*$/, \"\"),\r\n\t\t\tcallback = ActionsObject[action];\r\n\r\n\t\tif (callback) {\r\n\t\t\tconst result = callback(actionArgs, elements, promiseHandler, propertiesMap as string);\r\n\r\n\t\t\tif (result !== undefined) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\r\n\t\t\treturn elements || promise as any;\r\n\t\t} else if (!maybeSequence) {\r\n\t\t\tconsole.error(`VelocityJS: First argument (${propertiesMap}) was not a property map, a known action, or a registered redirect. Aborting.`);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tlet hasValidDuration: boolean;\r\n\r\n\tif (isPlainObject(propertiesMap) || isReverse || maybeSequence) {\r\n\t\t/**\r\n\t\t * The options for this set of animations.\r\n\t\t */\r\n\t\tconst options: StrictVelocityOptions = {};\r\n\t\tlet isSync = defaults.sync;\r\n\r\n\t\t// Private options first - set as non-enumerable, and starting with an\r\n\t\t// underscore so we can filter them out.\r\n\t\tif (promise) {\r\n\t\t\tdefineProperty(options, \"_promise\", promise);\r\n\t\t\tdefineProperty(options, \"_rejecter\", rejecter);\r\n\t\t\tdefineProperty(options, \"_resolver\", resolver);\r\n\t\t}\r\n\t\tdefineProperty(options, \"_ready\", 0);\r\n\t\tdefineProperty(options, \"_started\", 0);\r\n\t\tdefineProperty(options, \"_completed\", 0);\r\n\t\tdefineProperty(options, \"_total\", 0);\r\n\r\n\t\t// Now check the optionsMap\r\n\t\tif (isPlainObject(optionsMap)) {\r\n\t\t\tconst validDuration = validateDuration(optionsMap.duration);\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\toptions.duration = getValue(validDuration, defaults.duration);\r\n\t\t\toptions.delay = getValue(validateDelay(optionsMap.delay), defaults.delay);\r\n\t\t\t// Need the extra fallback here in case it supplies an invalid\r\n\t\t\t// easing that we need to overrride with the default.\r\n\t\t\toptions.easing = validateEasing(getValue(optionsMap.easing, defaults.easing), options.duration) || validateEasing(defaults.easing, options.duration);\r\n\t\t\toptions.loop = getValue(validateLoop(optionsMap.loop), defaults.loop);\r\n\t\t\toptions.repeat = options.repeatAgain = getValue(validateRepeat(optionsMap.repeat), defaults.repeat);\r\n\t\t\tif (optionsMap.speed != null) {\r\n\t\t\t\toptions.speed = getValue(validateSpeed(optionsMap.speed), 1);\r\n\t\t\t}\r\n\t\t\tif (isBoolean(optionsMap.promise)) {\r\n\t\t\t\toptions.promise = optionsMap.promise;\r\n\t\t\t}\r\n\t\t\toptions.queue = getValue(validateQueue(optionsMap.queue), defaults.queue);\r\n\t\t\tif (optionsMap.mobileHA && !StateObject.isGingerbread) {\r\n\t\t\t\t/* When set to true, and if this is a mobile device, mobileHA automatically enables hardware acceleration (via a null transform hack)\r\n\t\t\t\t on animating elements. HA is removed from the element at the completion of its animation. */\r\n\t\t\t\t/* Note: Android Gingerbread doesn't support HA. If a null transform hack (mobileHA) is in fact set, it will prevent other tranform subproperties from taking effect. */\r\n\t\t\t\t/* Note: You can read more about the use of mobileHA in Velocity's documentation: velocity-animate/#mobileHA. */\r\n\t\t\t\toptions.mobileHA = true;\r\n\t\t\t}\r\n\t\t\tif (!isReverse) {\r\n\t\t\t\tif (optionsMap.display != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).display = optionsMap.display as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.display\" used, this is now a property:`, optionsMap.display);\r\n\t\t\t\t}\r\n\t\t\t\tif (optionsMap.visibility != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).visibility = optionsMap.visibility as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.visibility\" used, this is now a property:`, optionsMap.visibility);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: Allow functional options for different options per element\r\n\t\t\tconst optionsBegin = validateBegin(optionsMap.begin),\r\n\t\t\t\toptionsComplete = validateComplete(optionsMap.complete),\r\n\t\t\t\toptionsProgress = validateProgress(optionsMap.progress),\r\n\t\t\t\toptionsSync = validateSync(optionsMap.sync);\r\n\r\n\t\t\tif (optionsBegin != null) {\r\n\t\t\t\toptions.begin = optionsBegin;\r\n\t\t\t}\r\n\t\t\tif (optionsComplete != null) {\r\n\t\t\t\toptions.complete = optionsComplete;\r\n\t\t\t}\r\n\t\t\tif (optionsProgress != null) {\r\n\t\t\t\toptions.progress = optionsProgress;\r\n\t\t\t}\r\n\t\t\tif (optionsSync != null) {\r\n\t\t\t\tisSync = optionsSync;\r\n\t\t\t}\r\n\t\t} else if (!syntacticSugar) {\r\n\t\t\t// Expand any direct options if possible.\r\n\t\t\tconst validDuration = validateDuration(args[argumentIndex], true);\r\n\t\t\tlet offset = 0;\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\tif (validDuration !== undefined) {\r\n\t\t\t\toffset++;\r\n\t\t\t\toptions.duration = validDuration;\r\n\t\t\t}\r\n\t\t\tif (!isFunction(args[argumentIndex + offset])) {\r\n\t\t\t\t// Despite coming before Complete, we can't pass a fn easing\r\n\t\t\t\tconst easing = validateEasing(args[argumentIndex + offset], getValue(options && validateDuration(options.duration), defaults.duration) as number, true);\r\n\r\n\t\t\t\tif (easing !== undefined) {\r\n\t\t\t\t\toffset++;\r\n\t\t\t\t\toptions.easing = easing;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst complete = validateComplete(args[argumentIndex + offset], true);\r\n\r\n\t\t\tif (complete !== undefined) {\r\n\t\t\t\toptions.complete = complete;\r\n\t\t\t}\r\n\t\t\toptions.loop = defaults.loop;\r\n\t\t\toptions.repeat = options.repeatAgain = defaults.repeat;\r\n\t\t}\r\n\r\n\t\tif (isReverse && options.queue === false) {\r\n\t\t\tthrow new Error(\"VelocityJS: Cannot reverse a queue:false animation.\");\r\n\t\t}\r\n\r\n\t\tif (maybeSequence && !hasValidDuration && maybeSequence.duration) {\r\n\t\t\toptions.duration = maybeSequence.duration;\r\n\t\t}\r\n\r\n\t\t// When a set of elements is targeted by a Velocity call, the set is\r\n\t\t// broken up and each element has the current Velocity call individually\r\n\t\t// queued onto it. In this way, each element's existing queue is\r\n\t\t// respected; some elements may already be animating and accordingly\r\n\t\t// should not have this current Velocity call triggered immediately\r\n\t\t// unless the sync:true option is used.\r\n\r\n\t\tconst rootAnimation: AnimationCall = {\r\n\t\t\toptions,\r\n\t\t\telements,\r\n\t\t\t_prev: undefined,\r\n\t\t\t_next: undefined,\r\n\t\t\t_flags: isSync ? AnimationFlags.SYNC : 0,\r\n\t\t\tpercentComplete: 0,\r\n\t\t\tellapsedTime: 0,\r\n\t\t\ttimeStart: 0,\r\n\t\t};\r\n\r\n\t\tanimations = [];\r\n\t\tfor (const element of elements) {\r\n\t\t\tlet flags = 0;\r\n\r\n\t\t\tif (isNode(element)) { // TODO: This needs to check for valid animation targets, not just Elements\r\n\t\t\t\tif (isReverse) {\r\n\t\t\t\t\tconst lastAnimation = Data(element).lastAnimationList[options.queue as string];\r\n\r\n\t\t\t\t\tpropertiesMap = lastAnimation && lastAnimation.tweens;\r\n\t\t\t\t\tif (!propertiesMap) {\r\n\t\t\t\t\t\tconsole.error(`VelocityJS: Attempting to reverse an animation on an element with no previous animation:`, element);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tflags |= AnimationFlags.REVERSE & ~(lastAnimation._flags & AnimationFlags.REVERSE); // tslint:disable-line:no-bitwise\r\n\t\t\t\t}\r\n\t\t\t\tconst animation: AnimationCall = {\r\n\t\t\t\t\t...rootAnimation,\r\n\t\t\t\t\telement,\r\n\t\t\t\t\t_flags: rootAnimation._flags | flags, // tslint:disable-line:no-bitwise\r\n\t\t\t\t};\r\n\r\n\t\t\t\toptions._total++;\r\n\t\t\t\tanimations.push(animation);\r\n\t\t\t\tif (maybeSequence) {\r\n\t\t\t\t\texpandSequence(animation, maybeSequence);\r\n\t\t\t\t} else if (isReverse) {\r\n\t\t\t\t\t// In this case we're using the previous animation, so\r\n\t\t\t\t\t// it will be expanded correctly when that one runs.\r\n\t\t\t\t\tanimation.tweens = propertiesMap as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tanimation.tweens = Object.create(null);\r\n\t\t\t\t\texpandProperties(animation, propertiesMap);\r\n\t\t\t\t}\r\n\t\t\t\tqueue(element, animation, options.queue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (StateObject.isTicking === false) {\r\n\t\t\t// If the animation tick isn't running, start it. (Velocity shuts it\r\n\t\t\t// off when there are no active calls to process.)\r\n\t\t\ttick(false);\r\n\t\t}\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t/***************\r\n\t Chaining\r\n\t ***************/\r\n\r\n\t/* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */\r\n\treturn elements || promise as any;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {defineProperty} from \"../utility\";\r\nimport {Velocity} from \"../velocityFn\";\r\n\r\n/**\r\n * Used to patch any object to allow Velocity chaining. In order to chain an\r\n * object must either be treatable as an array - with a .length\r\n * property, and each member a Node, or a Node directly.\r\n *\r\n * By default Velocity will try to patch window,\r\n * jQuery, Zepto, and several classes that return\r\n * Nodes or lists of Nodes.\r\n */\r\nexport function patch(proto: any, global?: boolean) {\r\n\ttry {\r\n\t\tdefineProperty(proto, (global ? \"V\" : \"v\") + \"elocity\", Velocity);\r\n\t} catch (e) {\r\n\t\tconsole.warn(`VelocityJS: Error when trying to add prototype.`, e);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n"],"names":["variable","Object","prototype","toString","call","nodeType","proto","getPrototypeOf","hasOwnProperty","constructor","isNumber","length","isFunction","velocity","window","isString","isNode","obj","property","propertyIsEnumerable","element","className","Element","classList","add","removeClass","arrayLike","Array","slice","name","value","readonly","defineProperty","configurable","writable","args","arguments","arg","undefined","now","Date","getTime","remove","replace","RegExp","Actions","internal","callback","console","warn","registerAction","DURATION_FAST","DURATION_NORMAL","DURATION_SLOW","FUZZY_MS_PER_SECOND","DEFAULT_CACHE","DEFAULT_DELAY","DEFAULT_DURATION","DEFAULT_EASING","DEFAULT_FPSLIMIT","DEFAULT_LOOP","DEFAULT_PROMISE","DEFAULT_PROMISE_REJECT_EMPTY","DEFAULT_QUEUE","DEFAULT_REPEAT","DEFAULT_SPEED","DEFAULT_SYNC","CLASSNAME","Duration","fast","normal","slow","Easings","registerEasing","percentComplete","startValue","endValue","Math","cos","PI","exp","linearEasing","swingEasing","springEasing","num","min","max","aA1","aA2","aT","A","B","C","mX1","mY1","mX2","mY2","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","i","isNaN","isFinite","fixRange","mSampleValues","Float32Array","aX","aGuessT","currentSlope","getSlope","currentX","calcBezier","aA","aB","currentT","abs","lastSample","intervalStart","currentSample","dist","guessForT","initialSlope","newtonRaphsonIterate","binarySubdivide","precomputed","calcSampleValues","str","f","precompute","getTForX","getControlPoints","x","y","easeIn","generateBezier","easeOut","easeInOut","state","tension","friction","v","initialState","dt","derivative","dx","dv","springAccelerationForState","a","b","springEvaluateStateWithDerivative","c","d","dxdt","dvdt","duration","initState","parseFloat","path","tolerance","DT","haveDuration","timeLapsed","lastState","generateSpringRK4","springIntegrateState","push","floor","cache","steps","fn","round","def","toLowerCase","parseDuration","isBoolean","noError","parsed","error","isArray","generateStep","apply","parseInt","defaults","mobileHA","begin","complete","delay","easing","fpsLimit","loop","minFrameTime","promise","promiseRejectEmpty","queue","repeat","speed","sync","defineProperties","reset","enumerable","validateEasing","get","set","validateCache","validateBegin","validateComplete","validateDelay","validateDuration","validateFpsLimit","validateLoop","validatePromise","validatePromiseRejectEmpty","validateQueue","validateRepeat","validateSpeed","validateSync","Normalizations","NormalizationUnits","NoCacheNormalizations","Set","constructors","constructorCache","Map","dataName","data","ownerDocument","defaultView","types","index","newData","count","computedStyle","queueList","lastAnimationList","lastFinishList","isClient","windowScrollAnchor","pageYOffset","State","isMobile","test","navigator","userAgent","isAndroid","isGingerbread","isChrome","chrome","isFirefox","prefixElement","document","createElement","scrollAnchor","documentElement","body","parentNode","scrollPropertyLeft","scrollPropertyTop","isTicking","first","last","firstNew","animation","prev","_prev","_next","Data","addClass","queueName","animate","skip","next","options","activeCall","elements","setTimeout","getValue","isLoop","isRepeat","isStopped","_flags","repeatAgain","timeStart","ellapsedTime","_completed","_total","callComplete","resolver","_resolver","dequeue","freeAnimationCall","indexOf","nextArg","has","unit","units","includes","propertyName","registerNormalization","hasNormalization","propertyValue","noCache","getNormalization","Velocity","debug","info","fixed","$","letter","toUpperCase","rxColor6","rxColor3","rxColorName","rxRGB","rxSpaces","ColorNames","ignore","r","g","makeRGBA","$0","$1","$2","wantInner","isBorderBox","getPropertyValue","sides","fields","augment","field","getBoundingClientRect","augmentDimension","getComputedStyle","computedValue","setPropertyValue","getWidthHeight","String","style","position","topLeft","skipCache","rxHex","commands","function","elementArrayIndex","tween","number","getNormalizationUnit","string","fixColors","properties","tweens","create","camelCase","valueData","log","arr1","arr2","end","start","explodeTween","rxToken","rxNumber","parts","partsLength","tokens","indexes","numbers","part","cloneArray","match","sequence","pattern","addString","text","returnStringType","isDisplay","isVisibility","more","bits","isUnitless","hasNumbers","token","digits","change","changeOrUnit","index2","splice","firstLetter","patternCalc","isComplex","isMaths","bit","substring","inRGB","starting","findPattern","startNumbers","percent","JSON","stringify","timeCurrent","tweenValue","progress","nextCall","firstProgress","_nextProgress","callProgress","lastTick","firstComplete","_nextComplete","completeCall","FRAME_TIME","performance","perf","nowOffset","timing","navigationStart","rAFProxy","rAFShim","requestAnimationFrame","ticking","worker","interval","onmessage","e","setInterval","postMessage","clearInterval","Worker","URL","createObjectURL","Blob","workerFn","tick","asyncCallbacks","hidden","addEventListener","timestamp","deltaTime","defaultSpeed","defaultEasing","defaultDuration","lastProgress","lastComplete","validateTweens","flags","_ready","_started","_first","callBegin","delta","activeEasing","millisecondsEllapsed","mock","reverse","currentValue","easingComplete","best","j","tweenFrom","tweenTo","tweenPercent","result","startsWith","defaultQueue","endValues","promiseHandler","finishAll","isVelocityResult","animations","checkAnimationShouldBeFinished","then","finish","animationFlags","isExpanded","isReady","isStarted","isPaused","isSync","isReverse","action","key","flag","isPercentComplete","option","checkAnimation","pauseResume","SyntaxError","checkAnimationShouldBeStopped","stop","isPlainObject","_rejecter","join","styleAction","requireForcefeeding","Error","fakeAnimation","singleResult","maybeSequence","SequencesObject","expandSequence","expandProperties","propertyTween","tweenEasing","tweenAction","colorValues","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color","amount","pow","registerBackIn","registerBackOut","registerBackInOut","easeOutBouncePercent","easeInBouncePercent","easeInBounce","easeOutBounce","easeInOutBounce","PI2","amplitude","period","sin","asin","s","registerElasticIn","registerElasticOut","registerElasticInOut","atStart","during","atEnd","getDimension","inlineRx","listItemRx","tableRowRx","tableRx","tableRowGroupRx","computePropertyValue","nodeName","display","clientWidth","scrollWidth","clientHeight","scrollHeight","direction","client","scrollValue","scroll","rxAddPx","unprefixed","rxVendors","addUnit","getSetPrefixed","getSetStyle","getAttribute","setAttribute","base","rxSubtype","rxElement","getOwnPropertyNames","forEach","subtype","exec","createElementNS","attribute","getBBox","getSetTween","VERSION","VelocityFn","VelocityStatic","ActionsObject","EasingsObject","StateObject","DefaultObject","patchFn","IE","documentMode","div","innerHTML","getElementsByTagName","jQuery","Zepto","NodeList","HTMLCollection","rxPercents","registerSequence","percents","percentages","sequenceList","keys","orderedPercents","sort","a1","b1","stepProperties","realSequence","originalProperty","argsList","args0","syntacticSugar","p","names","argumentIndex","propertiesMap","optionsMap","rejecter","isWrapped","bind","isAction","opts","o","Promise","resolve","reject","catch","finally","actionArgs","_promise","hasValidDuration","validDuration","visibility","optionsBegin","optionsComplete","optionsProgress","validateProgress","optionsSync","offset","rootAnimation","lastAnimation","global"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA;;;AAGA,qBAA0BA;EACzB,WAAOA,aAAa,IAAb,IAAqBA,aAAa,KAAzC;EACA;AAED,EAaA;;;AAGA,sBAA2BA;EAC1B,WAAOC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,QAA/B,MAA6C,mBAApD;EACA;EAED;;;AAGA,kBAAuBA;EACtB,WAAO,CAAC,EAAEA,YAAaA,SAAqBK,QAApC,CAAR;EACA;EAED;;;AAGA,oBAAyBL;EACxB,WAAO,OAAOA,QAAP,KAAoB,QAA3B;EACA;AAED,EAOA;;;AAGA,yBAA8BA;EAC7B,QAAI,CAACA,QAAD,IAAa,QAAOA,QAAP,yCAAOA,QAAP,OAAoB,QAAjC,IAA8CA,SAAqBK,QAAnE,IAA+EJ,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,QAA/B,MAA6C,iBAAhI,EAAmJ;EAClJ,eAAO,KAAP;EACA;EACD,QAAMM,QAAQL,OAAOM,cAAP,CAAsBP,QAAtB,CAAd;EAEA,WAAO,CAACM,KAAD,IAAWA,MAAME,cAAN,CAA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,QAAzB,EAAmC;EAClC2L,uBADkC;EAEjC,+BAAOkgB,iBAAe7rB,QAAf,CAAP;EACA,qBAHiC;EAIlC4L,uBAJkC,kBAI9BhL,KAJ8B;EAKjCirB,yCAAe7rB,QAAf,IAA2BY,KAA3B;EACA;EANiC,iBAAnC,EAOG,IAPH;EAQA;EAED;EACCE,iCAAekR,UAAf,EAAyBhS,QAAzB,EAAmC6rB,iBAAe7rB,QAAf,CAAnC,EAA6D,IAA7D;EACA;EAfF;EAiBA;;;EAnBF,KAAK,IAAMA,UAAX,IAAuB6rB,gBAAvB,EAAuC;EAAA,YAA5B7rB,UAA4B;EAoBtC;;;;"} \ No newline at end of file +{"version":3,"file":"velocity.js","sources":["src/types.ts","src/utility.ts","src/Velocity/actions/actions.ts","src/constants.ts","src/Velocity/easing/easings.ts","src/Velocity/easing/bezier.ts","src/Velocity/easing/spring_rk4.ts","src/Velocity/easing/step.ts","src/Velocity/options.ts","src/Velocity/defaults.ts","src/Velocity/normalizations/normalizationsObject.ts","src/Velocity/data.ts","src/Velocity/state.ts","src/Velocity/queue.ts","src/Velocity/complete.ts","src/Velocity/normalizations/normalizations.ts","src/Velocity/css/setPropertyValue.ts","src/Velocity/camelCase.ts","src/Velocity/css/fixColors.ts","src/Velocity/css/augmentDimension.ts","src/Velocity/css/getPropertyValue.ts","src/Velocity/tweens.ts","src/Velocity/tick.ts","src/Velocity/actions/finish.ts","src/Velocity/actions/option.ts","src/Velocity/actions/pauseResume.ts","src/Velocity/actions/reverse.ts","src/Velocity/actions/stop.ts","src/Velocity/actions/style.ts","src/Velocity/actions/tween.ts","src/Velocity/css/colors.ts","src/Velocity/easing/back.ts","src/Velocity/easing/bounce.ts","src/Velocity/easing/elastic.ts","src/Velocity/easing/string.ts","src/Velocity/normalizations/dimensions.ts","src/Velocity/normalizations/display.ts","src/Velocity/normalizations/scroll.ts","src/Velocity/normalizations/style.ts","src/Velocity/normalizations/svg/attributes.ts","src/Velocity/normalizations/svg/dimensions.ts","src/Velocity/normalizations/tween.ts","version.ts","src/velocity.ts","src/Velocity/sequences.ts","src/velocityFn.ts","src/Velocity/patch.ts","src/velocity.ts"],"sourcesContent":["/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Runtime type checking methods.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityResult} from \"./../velocity.d\";\r\n\r\n/**\r\n * Check if a variable is a boolean.\r\n */\r\nexport function isBoolean(variable: any): variable is boolean {\r\n\treturn variable === true || variable === false;\r\n}\r\n\r\n/**\r\n * Check if a variable is an empty object.\r\n */\r\nexport function isEmptyObject(variable: {}): variable is {} {\r\n\tfor (const name in variable) {\r\n\t\tif (variable.hasOwnProperty(name)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Check if a variable is a function.\r\n */\r\nexport function isFunction(variable: any): variable is Function { // tslint:disable-line:ban-types\r\n\treturn Object.prototype.toString.call(variable) === \"[object Function]\";\r\n}\r\n\r\n/**\r\n * Check if a variable is an HTMLElement or SVGElement.\r\n */\r\nexport function isNode(variable: any): variable is HTMLorSVGElement {\r\n\treturn !!(variable && (variable as Element).nodeType);\r\n}\r\n\r\n/**\r\n * Check if a variable is a number.\r\n */\r\nexport function isNumber(variable: any): variable is number {\r\n\treturn typeof variable === \"number\";\r\n}\r\n\r\n/**\r\n * Faster way to parse a string/number as a number https://jsperf.com/number-vs-parseint-vs-plus/3\r\n */\r\nexport function isNumberWhenParsed(variable: any): variable is number {\r\n\treturn !isNaN(Number(variable));\r\n}\r\n\r\n/**\r\n * Check if a variable is a plain object (and not an instance).\r\n */\r\nexport function isPlainObject(variable: any): variable is {} {\r\n\tif (!variable || typeof variable !== \"object\" || (variable as Element).nodeType || Object.prototype.toString.call(variable) !== \"[object Object]\") {\r\n\t\treturn false;\r\n\t}\r\n\tconst proto = Object.getPrototypeOf(variable) as object;\r\n\r\n\treturn !proto || (proto.hasOwnProperty(\"constructor\") && proto.constructor === Object);\r\n}\r\n\r\n/**\r\n * Check if a variable is an SVGElement.\r\n */\r\nexport function isSVG(variable: any): variable is SVGElement {\r\n\treturn SVGElement && variable instanceof SVGElement;\r\n}\r\n\r\n/**\r\n * Check if a variable is a string.\r\n */\r\nexport function isString(variable: any): variable is string {\r\n\treturn typeof variable === \"string\";\r\n}\r\n\r\n/**\r\n * Check if a variable is the result of calling Velocity.\r\n */\r\nexport function isVelocityResult(variable: any): variable is VelocityResult {\r\n\treturn variable && isNumber((variable as VelocityResult).length) && isFunction((variable as VelocityResult).velocity);\r\n}\r\n\r\n/**\r\n * Check if a variable is an array-like wrapped jQuery, Zepto or similar, where\r\n * each indexed value is a Node.\r\n */\r\n\r\nexport function isWrapped(variable: any): variable is HTMLorSVGElement[] {\r\n\treturn variable\r\n\t\t&& variable !== window\r\n\t\t&& isNumber((variable as HTMLorSVGElement[]).length)\r\n\t\t&& !isString(variable)\r\n\t\t&& !isFunction(variable)\r\n\t\t&& !isNode(variable)\r\n\t\t&& ((variable as HTMLorSVGElement[]).length === 0 || isNode(variable[0]));\r\n}\r\n\r\n/**\r\n * Check is a property is an enumerable member of an object.\r\n */\r\nexport function propertyIsEnumerable(obj: object, property: string): boolean {\r\n\treturn Object.prototype.propertyIsEnumerable.call(obj, property);\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isNode} from \"./types\";\r\n\r\n/**\r\n * Add a single className to an Element.\r\n */\r\nexport function addClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.add(className);\r\n\t\t} else {\r\n\t\t\tremoveClass(element, className);\r\n\t\t\t(element as any).className += (element.className.length ? \" \" : \"\") + className;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Clone an array, works for array-like too.\r\n */\r\nexport function cloneArray(arrayLike: T[] | ArrayLike): T[] {\r\n\treturn Array.prototype.slice.call(arrayLike, 0);\r\n}\r\n\r\n/**\r\n * The defineProperty() function provides a\r\n * shortcut to defining a property that cannot be accidentally iterated across.\r\n */\r\nexport function defineProperty(proto: any, name: string, value: any, readonly?: boolean) {\r\n\tif (proto) {\r\n\t\tObject.defineProperty(proto, name, {\r\n\t\t\tconfigurable: !readonly,\r\n\t\t\twritable: !readonly,\r\n\t\t\tvalue,\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * When there are multiple locations for a value pass them all in, then get the\r\n * first value that is valid.\r\n */\r\nexport function getValue(...args: T[]): T {\r\n\tfor (const arg of arguments) {\r\n\t\tif (arg !== undefined && arg === arg) {\r\n\t\t\treturn arg;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Shim to get the current milliseconds - on anything except old IE it'll use\r\n * Date.now() and save creating an object. If that doesn't exist then it'll\r\n * create one that gets GC.\r\n */\r\nexport const now = Date.now ? Date.now : () => {\r\n\treturn (new Date()).getTime();\r\n};\r\n\r\n/**\r\n * Remove a single className from an Element.\r\n */\r\nexport function removeClass(element: HTMLorSVGElement, className: string): void {\r\n\tif (element instanceof Element) {\r\n\t\tif (element.classList) {\r\n\t\t\telement.classList.remove(className);\r\n\t\t} else {\r\n\t\t\t// TODO: Need some jsperf tests on performance - can we get rid of the regex and maybe use split / array manipulation?\r\n\t\t\t(element as any).className = element.className.replace(new RegExp(`(^|\\\\s)${className}(\\\\s|$)`, \"gi\"), \" \");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Convert an element or array-like element list into an array if needed.\r\n */\r\nexport function sanitizeElements(elements: HTMLorSVGElement | HTMLorSVGElement[]): HTMLorSVGElement[] {\r\n\treturn isNode(elements)\r\n\t\t? [elements] as HTMLorSVGElement[]\r\n\t\t: elements as HTMLorSVGElement[];\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityActionFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString, propertyIsEnumerable} from \"../../types\";\r\nimport {defineProperty} from \"../../utility\";\r\n\r\n// Constants\r\nexport const Actions: {[name: string]: VelocityActionFn} = {};\r\n\r\n/**\r\n * Used to register an action. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerAction\", \"name\", VelocityActionFn);\r\n */\r\nexport function registerAction(args?: [string, VelocityActionFn], internal?: boolean) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' callback to an invalid value:`, name, callback);\r\n\t} else if (Actions[name] && !propertyIsEnumerable(Actions, name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override internal 'registerAction' callback`, name);\r\n\t} else if (internal === true) {\r\n\t\tdefineProperty(Actions, name, callback);\r\n\t} else {\r\n\t\tActions[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerAction\", registerAction as any], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Constants and defaults. These values should never change without a MINOR\r\n * version bump.\r\n */\r\n\r\n/**\r\n * Without this it will only un-prefix properties that have a valid \"normal\"\r\n * version.\r\n */\r\nexport const ALL_VENDOR_PREFIXES = true;\r\n\r\nexport const DURATION_FAST = 200;\r\nexport const DURATION_NORMAL = 400;\r\nexport const DURATION_SLOW = 600;\r\n\r\nexport const FUZZY_MS_PER_SECOND = 980;\r\n\r\nexport const DEFAULT_CACHE = true;\r\nexport const DEFAULT_DELAY = 0;\r\nexport const DEFAULT_DURATION = DURATION_NORMAL;\r\nexport const DEFAULT_EASING = \"swing\";\r\nexport const DEFAULT_FPSLIMIT = 60;\r\nexport const DEFAULT_LOOP = 0;\r\nexport const DEFAULT_PROMISE = true;\r\nexport const DEFAULT_PROMISE_REJECT_EMPTY = true;\r\nexport const DEFAULT_QUEUE = \"\";\r\nexport const DEFAULT_REPEAT = 0;\r\nexport const DEFAULT_SPEED = 1;\r\nexport const DEFAULT_SYNC = true;\r\n\r\nexport const CLASSNAME = \"velocity-animating\";\r\n\r\nexport const Duration = {\r\n\tfast: DURATION_FAST,\r\n\tnormal: DURATION_NORMAL,\r\n\tslow: DURATION_SLOW,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\n\r\n// Constants\r\nexport const Easings: {[name: string]: VelocityEasingFn} = {};\r\n\r\n/**\r\n * Used to register a easing. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerEasing\", \"name\", VelocityEasingFn);\r\n */\r\nexport function registerEasing(args?: [string, VelocityEasingFn]) {\r\n\tconst name: string = args[0],\r\n\t\tcallback = args[1];\r\n\r\n\tif (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' callback to an invalid value:`, name, callback);\r\n\t} else if (Easings[name]) {\r\n\t\tconsole.warn(`VelocityJS: Trying to override 'registerEasing' callback`, name);\r\n\t} else {\r\n\t\tEasings[name] = callback;\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerEasing\", registerEasing], true);\r\n\r\n/**\r\n * Linear easing, used for sequence parts that don't have an actual easing\r\n * function.\r\n */\r\nexport function linearEasing(percentComplete, startValue, endValue, property) {\r\n\treturn startValue + percentComplete * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * Swing is the default for jQuery and Velocity.\r\n */\r\nexport function swingEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (0.5 - Math.cos(percentComplete * Math.PI) / 2) * (endValue - startValue);\r\n}\r\n\r\n/**\r\n * A less exaggerated version of easeInOutElastic.\r\n */\r\nexport function springEasing(percentComplete, startValue, endValue) {\r\n\treturn startValue + (1 - (Math.cos(percentComplete * 4.5 * Math.PI) * Math.exp(-percentComplete * 6))) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"linear\", linearEasing]);\r\nregisterEasing([\"swing\", swingEasing]);\r\nregisterEasing([\"spring\", springEasing]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Fix to a range of 0 <= num <= 1.\r\n */\r\nfunction fixRange(num: number) {\r\n\treturn Math.min(Math.max(num, 0), 1);\r\n}\r\n\r\nfunction A(aA1, aA2) {\r\n\treturn 1 - 3 * aA2 + 3 * aA1;\r\n}\r\n\r\nfunction B(aA1, aA2) {\r\n\treturn 3 * aA2 - 6 * aA1;\r\n}\r\n\r\nfunction C(aA1) {\r\n\treturn 3 * aA1;\r\n}\r\n\r\nfunction calcBezier(aT, aA1, aA2) {\r\n\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\r\n}\r\n\r\nfunction getSlope(aT, aA1, aA2) {\r\n\treturn 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);\r\n}\r\n\r\nexport function generateBezier(mX1: number, mY1: number, mX2: number, mY2: number): VelocityEasingFn {\r\n\tconst NEWTON_ITERATIONS = 4,\r\n\t\tNEWTON_MIN_SLOPE = 0.001,\r\n\t\tSUBDIVISION_PRECISION = 0.0000001,\r\n\t\tSUBDIVISION_MAX_ITERATIONS = 10,\r\n\t\tkSplineTableSize = 11,\r\n\t\tkSampleStepSize = 1 / (kSplineTableSize - 1),\r\n\t\tfloat32ArraySupported = \"Float32Array\" in window;\r\n\r\n\t/* Must contain four arguments. */\r\n\tif (arguments.length !== 4) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/* Arguments must be numbers. */\r\n\tfor (let i = 0; i < 4; ++i) {\r\n\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\t/* X values must be in the [0, 1] range. */\r\n\tmX1 = fixRange(mX1);\r\n\tmX2 = fixRange(mX2);\r\n\r\n\tconst mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n\r\n\tfunction newtonRaphsonIterate(aX, aGuessT) {\r\n\t\tfor (let i = 0; i < NEWTON_ITERATIONS; ++i) {\r\n\t\t\tconst currentSlope = getSlope(aGuessT, mX1, mX2);\r\n\r\n\t\t\tif (currentSlope === 0) {\r\n\t\t\t\treturn aGuessT;\r\n\t\t\t}\r\n\r\n\t\t\tconst currentX = calcBezier(aGuessT, mX1, mX2) - aX;\r\n\t\t\taGuessT -= currentX / currentSlope;\r\n\t\t}\r\n\r\n\t\treturn aGuessT;\r\n\t}\r\n\r\n\tfunction calcSampleValues() {\r\n\t\tfor (let i = 0; i < kSplineTableSize; ++i) {\r\n\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction binarySubdivide(aX, aA, aB) {\r\n\t\tlet currentX, currentT, i = 0;\r\n\r\n\t\tdo {\r\n\t\t\tcurrentT = aA + (aB - aA) / 2;\r\n\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\r\n\t\t\tif (currentX > 0) {\r\n\t\t\t\taB = currentT;\r\n\t\t\t} else {\r\n\t\t\t\taA = currentT;\r\n\t\t\t}\r\n\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\r\n\r\n\t\treturn currentT;\r\n\t}\r\n\r\n\tfunction getTForX(aX) {\r\n\t\tconst lastSample = kSplineTableSize - 1;\r\n\t\tlet intervalStart = 0,\r\n\t\t\tcurrentSample = 1;\r\n\r\n\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\r\n\t\t\tintervalStart += kSampleStepSize;\r\n\t\t}\r\n\r\n\t\t--currentSample;\r\n\r\n\t\tconst dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\r\n\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\r\n\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\r\n\r\n\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\r\n\t\t\treturn newtonRaphsonIterate(aX, guessForT);\r\n\t\t} else if (initialSlope === 0) {\r\n\t\t\treturn guessForT;\r\n\t\t} else {\r\n\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\r\n\t\t}\r\n\t}\r\n\r\n\tlet precomputed = false;\r\n\r\n\tfunction precompute() {\r\n\t\tprecomputed = true;\r\n\t\tif (mX1 !== mY1 || mX2 !== mY2) {\r\n\t\t\tcalcSampleValues();\r\n\t\t}\r\n\t}\r\n\r\n\tconst str = `generateBezier(${[mX1, mY1, mX2, mY2]})`,\r\n\t\tf = (percentComplete: number, startValue: number, endValue: number, property?: string) => {\r\n\t\t\tif (!precomputed) {\r\n\t\t\t\tprecompute();\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 0) {\r\n\t\t\t\treturn startValue;\r\n\t\t\t}\r\n\t\t\tif (percentComplete === 1) {\r\n\t\t\t\treturn endValue;\r\n\t\t\t}\r\n\t\t\tif (mX1 === mY1 && mX2 === mY2) {\r\n\t\t\t\treturn startValue + percentComplete * (endValue - startValue);\r\n\t\t\t}\r\n\r\n\t\t\treturn startValue + calcBezier(getTForX(percentComplete), mY1, mY2) * (endValue - startValue);\r\n\t\t};\r\n\r\n\t(f as any).getControlPoints = () => {\r\n\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\r\n\t};\r\n\tf.toString = () => {\r\n\t\treturn str;\r\n\t};\r\n\r\n\treturn f;\r\n}\r\n\r\n/* Common easings */\r\nconst easeIn = generateBezier(0.42, 0, 1, 1),\r\n\teaseOut = generateBezier(0, 0, 0.58, 1),\r\n\teaseInOut = generateBezier(0.42, 0, 0.58, 1);\r\n\r\nregisterEasing([\"ease\", generateBezier(0.25, 0.1, 0.25, 1)]);\r\nregisterEasing([\"easeIn\", easeIn]);\r\nregisterEasing([\"ease-in\", easeIn]);\r\nregisterEasing([\"easeOut\", easeOut]);\r\nregisterEasing([\"ease-out\", easeOut]);\r\nregisterEasing([\"easeInOut\", easeInOut]);\r\nregisterEasing([\"ease-in-out\", easeInOut]);\r\nregisterEasing([\"easeInSine\", generateBezier(0.47, 0, 0.745, 0.715)]);\r\nregisterEasing([\"easeOutSine\", generateBezier(0.39, 0.575, 0.565, 1)]);\r\nregisterEasing([\"easeInOutSine\", generateBezier(0.445, 0.05, 0.55, 0.95)]);\r\nregisterEasing([\"easeInQuad\", generateBezier(0.55, 0.085, 0.68, 0.53)]);\r\nregisterEasing([\"easeOutQuad\", generateBezier(0.25, 0.46, 0.45, 0.94)]);\r\nregisterEasing([\"easeInOutQuad\", generateBezier(0.455, 0.03, 0.515, 0.955)]);\r\nregisterEasing([\"easeInCubic\", generateBezier(0.55, 0.055, 0.675, 0.19)]);\r\nregisterEasing([\"easeOutCubic\", generateBezier(0.215, 0.61, 0.355, 1)]);\r\nregisterEasing([\"easeInOutCubic\", generateBezier(0.645, 0.045, 0.355, 1)]);\r\nregisterEasing([\"easeInQuart\", generateBezier(0.895, 0.03, 0.685, 0.22)]);\r\nregisterEasing([\"easeOutQuart\", generateBezier(0.165, 0.84, 0.44, 1)]);\r\nregisterEasing([\"easeInOutQuart\", generateBezier(0.77, 0, 0.175, 1)]);\r\nregisterEasing([\"easeInQuint\", generateBezier(0.755, 0.05, 0.855, 0.06)]);\r\nregisterEasing([\"easeOutQuint\", generateBezier(0.23, 1, 0.32, 1)]);\r\nregisterEasing([\"easeInOutQuint\", generateBezier(0.86, 0, 0.07, 1)]);\r\nregisterEasing([\"easeInExpo\", generateBezier(0.95, 0.05, 0.795, 0.035)]);\r\nregisterEasing([\"easeOutExpo\", generateBezier(0.19, 1, 0.22, 1)]);\r\nregisterEasing([\"easeInOutExpo\", generateBezier(1, 0, 0, 1)]);\r\nregisterEasing([\"easeInCirc\", generateBezier(0.6, 0.04, 0.98, 0.335)]);\r\nregisterEasing([\"easeOutCirc\", generateBezier(0.075, 0.82, 0.165, 1)]);\r\nregisterEasing([\"easeInOutCirc\", generateBezier(0.785, 0.135, 0.15, 0.86)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\ninterface springState {\r\n\tx: number;\r\n\tv: number;\r\n\ttension: number;\r\n\tfriction: number;\r\n}\r\n\r\ninterface springDelta {\r\n\tdx: number;\r\n\tdv: number;\r\n}\r\n\r\n/* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\r\n/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass\r\n then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\r\nfunction springAccelerationForState(state: springState) {\r\n\treturn (-state.tension * state.x) - (state.friction * state.v);\r\n}\r\n\r\nfunction springEvaluateStateWithDerivative(initialState: springState, dt: number, derivative: springDelta): springDelta {\r\n\tconst state = {\r\n\t\tx: initialState.x + derivative.dx * dt,\r\n\t\tv: initialState.v + derivative.dv * dt,\r\n\t\ttension: initialState.tension,\r\n\t\tfriction: initialState.friction,\r\n\t};\r\n\r\n\treturn {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t};\r\n}\r\n\r\nfunction springIntegrateState(state: springState, dt: number) {\r\n\tconst a = {\r\n\t\tdx: state.v,\r\n\t\tdv: springAccelerationForState(state),\r\n\t},\r\n\t\tb = springEvaluateStateWithDerivative(state, dt * 0.5, a),\r\n\t\tc = springEvaluateStateWithDerivative(state, dt * 0.5, b),\r\n\t\td = springEvaluateStateWithDerivative(state, dt, c),\r\n\t\tdxdt = 1 / 6 * (a.dx + 2 * (b.dx + c.dx) + d.dx),\r\n\t\tdvdt = 1 / 6 * (a.dv + 2 * (b.dv + c.dv) + d.dv);\r\n\r\n\tstate.x = state.x + dxdt * dt;\r\n\tstate.v = state.v + dvdt * dt;\r\n\r\n\treturn state;\r\n}\r\n\r\nexport function generateSpringRK4(tension: number, friction: number): number;\r\nexport function generateSpringRK4(tension: number, friction: number, duration: number): VelocityEasingFn;\r\nexport function generateSpringRK4(tension: number, friction: number, duration?: number): any {\r\n\tconst initState: springState = {\r\n\t\tx: -1,\r\n\t\tv: 0,\r\n\t\ttension: parseFloat(tension as any) || 500,\r\n\t\tfriction: parseFloat(friction as any) || 20,\r\n\t},\r\n\t\tpath = [0],\r\n\t\ttolerance = 1 / 10000,\r\n\t\tDT = 16 / 1000,\r\n\t\thaveDuration = duration != null; // deliberate \"==\", as undefined == null != 0\r\n\tlet timeLapsed = 0,\r\n\t\tdt: number,\r\n\t\tlastState: springState;\r\n\r\n\t/* Calculate the actual time it takes for this animation to complete with the provided conditions. */\r\n\tif (haveDuration) {\r\n\t\t/* Run the simulation without a duration. */\r\n\t\ttimeLapsed = generateSpringRK4(initState.tension, initState.friction);\r\n\t\t/* Compute the adjusted time delta. */\r\n\t\tdt = (timeLapsed as number) / duration * DT;\r\n\t} else {\r\n\t\tdt = DT;\r\n\t}\r\n\r\n\twhile (true) {\r\n\t\t/* Next/step function .*/\r\n\t\tlastState = springIntegrateState(lastState || initState, dt);\r\n\t\t/* Store the position. */\r\n\t\tpath.push(1 + lastState.x);\r\n\t\ttimeLapsed += 16;\r\n\t\t/* If the change threshold is reached, break. */\r\n\t\tif (!(Math.abs(lastState.x) > tolerance && Math.abs(lastState.v) > tolerance)) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\r\n\t computed path and returns a snapshot of the position according to a given percentComplete. */\r\n\treturn !haveDuration ? timeLapsed : (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + path[Math.floor(percentComplete * (path.length - 1))] * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details\r\n *\r\n * Step easing generator.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityEasingFn} from \"../../../velocity.d\";\r\n\r\n// Constants\r\nconst cache: {[steps: number]: VelocityEasingFn} = {};\r\n\r\nexport function generateStep(steps): VelocityEasingFn {\r\n\tconst fn = cache[steps];\r\n\r\n\tif (fn) {\r\n\t\treturn fn;\r\n\t}\r\n\r\n\treturn cache[steps] = (percentComplete: number, startValue: number, endValue: number) => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn startValue + Math.round(percentComplete * steps) * (1 / steps) * (endValue - startValue);\r\n\t};\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Validation functions used for various types of data that can be supplied.\r\n * All errors are reported in the non-minified version for development. If a\r\n * validation fails then it should return undefined.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityCallback, VelocityEasingFn, VelocityEasingType, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {Duration} from \"../constants\";\r\nimport {isBoolean, isFunction, isNumber, isString} from \"../types\";\r\nimport {generateBezier} from \"./easing/bezier\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {generateSpringRK4} from \"./easing/spring_rk4\";\r\nimport {generateStep} from \"./easing/step\";\r\n\r\n/**\r\n * Parse a duration value and return an ms number. Optionally return a\r\n * default value if the number is not valid.\r\n */\r\nexport function parseDuration(duration: \"fast\" | \"normal\" | \"slow\" | number, def?: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tif (isNumber(duration)) {\r\n\t\treturn duration;\r\n\t}\r\n\tif (isString(duration)) {\r\n\t\treturn Duration[duration.toLowerCase()]\r\n\t\t\t|| parseFloat(duration.replace(\"ms\", \"\")\r\n\t\t\t\t.replace(\"s\", \"000\"));\r\n\t}\r\n\r\n\treturn def == null ? undefined : parseDuration(def);\r\n}\r\n\r\n/**\r\n * Validate a cache option.\r\n */\r\nexport function validateCache(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'cache' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a begin option.\r\n */\r\nexport function validateBegin(value: VelocityCallback): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'begin' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a complete option.\r\n */\r\nexport function validateComplete(value: VelocityCallback, noError?: true): VelocityCallback {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'complete' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a delay option.\r\n */\r\nexport function validateDelay(value: \"fast\" | \"normal\" | \"slow\" | number): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed)) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'delay' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a duration option.\r\n */\r\nexport function validateDuration(value: \"fast\" | \"normal\" | \"slow\" | number, noError?: true): number {\r\n\tconst parsed = parseDuration(value);\r\n\r\n\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\treturn parsed;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'duration' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a easing option.\r\n */\r\nexport function validateEasing(value: VelocityEasingType, duration: number, noError?: true): VelocityEasingFn {\r\n\tif (isString(value)) {\r\n\t\t// Named easing\r\n\t\treturn Easings[value];\r\n\t}\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\t// TODO: We should only do these if the correct function exists - don't force loading.\r\n\tif (Array.isArray(value)) {\r\n\t\tif (value.length === 1) {\r\n\t\t\t// Steps\r\n\t\t\treturn generateStep(value[0]);\r\n\t\t}\r\n\t\tif (value.length === 2) {\r\n\t\t\t// springRK4 must be passed the animation's duration.\r\n\t\t\t// Note: If the springRK4 array contains non-numbers,\r\n\t\t\t// generateSpringRK4() returns an easing function generated with\r\n\t\t\t// default tension and friction values.\r\n\t\t\treturn generateSpringRK4(value[0], value[1], duration);\r\n\t\t}\r\n\t\tif (value.length === 4) {\r\n\t\t\t// Note: If the bezier array contains non-numbers, generateBezier()\r\n\t\t\t// returns undefined.\r\n\t\t\treturn generateBezier.apply(null, value) || false;\r\n\t\t}\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'easing' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a fpsLimit option.\r\n */\r\nexport function validateFpsLimit(value: number | false): number {\r\n\tif (value === false) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\treturn Math.min(parsed, 60);\r\n\t\t}\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'fpsLimit' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a loop option.\r\n */\r\nexport function validateLoop(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'loop' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a progress option.\r\n */\r\nexport function validateProgress(value: VelocityProgress): VelocityProgress {\r\n\tif (isFunction(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'progress' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promise option.\r\n */\r\nexport function validatePromise(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promise' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a promiseRejectEmpty option.\r\n */\r\nexport function validatePromiseRejectEmpty(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'promiseRejectEmpty' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a queue option.\r\n */\r\nexport function validateQueue(value: string | false, noError?: true): string | false {\r\n\tif (value === false || isString(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null && !noError) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'queue' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a repeat option.\r\n */\r\nexport function validateRepeat(value: number | boolean): number | true {\r\n\tswitch (value) {\r\n\t\tcase false:\r\n\t\t\treturn 0;\r\n\r\n\t\tcase true:\r\n\t\t\treturn true;\r\n\r\n\t\tdefault:\r\n\t\t\tconst parsed = parseInt(value as any, 10);\r\n\r\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\r\n\t\t\t\treturn parsed;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'repeat' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a speed option.\r\n */\r\nexport function validateSpeed(value: number): number {\r\n\tif (isNumber(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'speed' to an invalid value:`, value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Validate a sync option.\r\n */\r\nexport function validateSync(value: boolean): boolean {\r\n\tif (isBoolean(value)) {\r\n\t\treturn value;\r\n\t}\r\n\tif (value != null) {\r\n\t\tconsole.error(`VelocityJS: Trying to set 'sync' to an invalid value:`, value);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Velocity option defaults, which can be overriden by the user.\r\n */\r\n\r\n// Typedefs\r\nimport {StrictVelocityOptions, VelocityCallback, VelocityEasingType} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean} from \"../types\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateEasing, validateFpsLimit, validateLoop, validatePromise, validatePromiseRejectEmpty,\r\n\tvalidateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./options\";\r\n\r\n// Constants\r\nimport {\r\n\tDEFAULT_CACHE, DEFAULT_DELAY, DEFAULT_DURATION, DEFAULT_EASING, DEFAULT_FPSLIMIT,\r\n\tDEFAULT_LOOP, DEFAULT_PROMISE, DEFAULT_PROMISE_REJECT_EMPTY, DEFAULT_QUEUE, DEFAULT_REPEAT,\r\n\tDEFAULT_SPEED, DEFAULT_SYNC, FUZZY_MS_PER_SECOND,\r\n} from \"../constants\";\r\n\r\nexport const defaults: StrictVelocityOptions & {reset?: () => void} = {\r\n\tmobileHA: true,\r\n};\r\n\r\n// NOTE: Add the variable here, then add the default state in \"reset\" below.\r\nlet cache: boolean,\r\n\tbegin: VelocityCallback,\r\n\tcomplete: VelocityCallback,\r\n\tdelay: number,\r\n\tduration: number,\r\n\teasing: VelocityEasingType,\r\n\tfpsLimit: number,\r\n\tloop: number | true,\r\n\tmobileHA: boolean,\r\n\tminFrameTime: number,\r\n\tpromise: boolean,\r\n\tpromiseRejectEmpty: boolean,\r\n\tqueue: string | false,\r\n\trepeat: number | true,\r\n\tspeed: number,\r\n\tsync: boolean;\r\n\r\n// IMPORTANT: Make sure any new defaults get added to the actions/set.ts list\r\nObject.defineProperties(defaults, {\r\n\treset: {\r\n\t\tenumerable: true,\r\n\t\tvalue() {\r\n\t\t\tcache = DEFAULT_CACHE;\r\n\t\t\tbegin = undefined;\r\n\t\t\tcomplete = undefined;\r\n\t\t\tdelay = DEFAULT_DELAY;\r\n\t\t\tduration = DEFAULT_DURATION;\r\n\t\t\teasing = validateEasing(DEFAULT_EASING, DEFAULT_DURATION);\r\n\t\t\tfpsLimit = DEFAULT_FPSLIMIT;\r\n\t\t\tloop = DEFAULT_LOOP;\r\n\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / DEFAULT_FPSLIMIT;\r\n\t\t\tpromise = DEFAULT_PROMISE;\r\n\t\t\tpromiseRejectEmpty = DEFAULT_PROMISE_REJECT_EMPTY;\r\n\t\t\tqueue = DEFAULT_QUEUE;\r\n\t\t\trepeat = DEFAULT_REPEAT;\r\n\t\t\tspeed = DEFAULT_SPEED;\r\n\t\t\tsync = DEFAULT_SYNC;\r\n\t\t},\r\n\t},\r\n\tcache: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn cache;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcache = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tbegin: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn begin;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tbegin = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tcomplete: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityCallback {\r\n\t\t\treturn complete;\r\n\t\t},\r\n\t\tset(value: VelocityCallback) {\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tcomplete = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tdelay: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn delay;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tdelay = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tduration: {\r\n\t\tenumerable: true,\r\n\t\tget(): \"fast\" | \"normal\" | \"slow\" | number {\r\n\t\t\treturn duration;\r\n\t\t},\r\n\t\tset(value: \"fast\" | \"normal\" | \"slow\" | number) {\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tduration = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\teasing: {\r\n\t\tenumerable: true,\r\n\t\tget(): VelocityEasingType {\r\n\t\t\treturn easing;\r\n\t\t},\r\n\t\tset(value: VelocityEasingType) {\r\n\t\t\tvalue = validateEasing(value, duration);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\teasing = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tfpsLimit: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn fpsLimit;\r\n\t\t},\r\n\t\tset(value: number | false) {\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tfpsLimit = value;\r\n\t\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tloop: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn loop;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tloop = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tmobileHA: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn mobileHA;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tif (isBoolean(value)) {\r\n\t\t\t\tmobileHA = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tminFrameTime: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | false {\r\n\t\t\treturn minFrameTime;\r\n\t\t},\r\n\t},\r\n\tpromise: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promise;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromise(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromise = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tpromiseRejectEmpty: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn promiseRejectEmpty;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validatePromiseRejectEmpty(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tpromiseRejectEmpty = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tqueue: {\r\n\t\tenumerable: true,\r\n\t\tget(): string | false {\r\n\t\t\treturn queue;\r\n\t\t},\r\n\t\tset(value: string | false) {\r\n\t\t\tvalue = validateQueue(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tqueue = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\trepeat: {\r\n\t\tenumerable: true,\r\n\t\tget(): number | true {\r\n\t\t\treturn repeat;\r\n\t\t},\r\n\t\tset(value: number | boolean) {\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\trepeat = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tspeed: {\r\n\t\tenumerable: true,\r\n\t\tget(): number {\r\n\t\t\treturn speed;\r\n\t\t},\r\n\t\tset(value: number) {\r\n\t\t\tvalue = validateSpeed(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tspeed = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tsync: {\r\n\t\tenumerable: true,\r\n\t\tget(): boolean {\r\n\t\t\treturn sync;\r\n\t\t},\r\n\t\tset(value: boolean) {\r\n\t\t\tvalue = validateSync(value);\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tsync = value;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n});\r\n\r\n// Reset to our default values, currently everything is undefined.\r\ndefaults.reset();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n/**\r\n * The highest type index for finding the best normalization for a property.\r\n */\r\nexport let MaxType: number = -1;\r\n\r\n/**\r\n * Unlike \"actions\", normalizations can always be replaced by users.\r\n */\r\nexport const Normalizations: {[name: string]: VelocityNormalizationsFn}[] = [];\r\n\r\n/**\r\n * Store a cross-reference to units to be added to specific normalization\r\n * functions if the user supplies a unit-less number.\r\n *\r\n * This is pretty much confined to adding \"px\" to several css properties.\r\n */\r\nexport const NormalizationUnits: {[unit: string]: VelocityNormalizationsFn[]} = {};\r\n\r\n/**\r\n * Any normalisations that should never be cached are listed here.\r\n * Faster than an array - https://jsperf.com/array-includes-and-find-methods-vs-set-has\r\n */\r\nexport const NoCacheNormalizations = new Set();\r\n\r\n/**\r\n * Used to define a constructor.\r\n */\r\nexport interface ClassConstructor {\r\n\tnew(): object;\r\n}\r\n\r\n/**\r\n * An array of classes used for the per-class normalizations. This\r\n * translates into a bitwise enum for quick cross-reference, and so that\r\n * the element doesn't need multiple instanceof calls every\r\n * frame.\r\n */\r\nexport const constructors: (ClassConstructor | string)[] = [];\r\n\r\n/**\r\n * A cache of the various constructors we've found and mapping to their real\r\n * name - saves expensive lookups.\r\n */\r\nexport const constructorCache = new Map();\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {ElementData, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {constructors} from \"./normalizations/normalizationsObject\";\r\n\r\n// Constants\r\nconst dataName = \"velocityData\";\r\n\r\n/**\r\n * Get (and create) the internal data store for an element.\r\n */\r\nexport function Data(element: HTMLorSVGElement): ElementData {\r\n\t// Use a string member so Uglify doesn't mangle it.\r\n\tconst data = element[dataName];\r\n\r\n\tif (data) {\r\n\t\treturn data;\r\n\t}\r\n\tconst window = element.ownerDocument.defaultView;\r\n\tlet types = 0;\r\n\r\n\tfor (let index = 0; index < constructors.length; index++) {\r\n\t\tconst constructor = constructors[index];\r\n\r\n\t\tif (isString(constructor)) {\r\n\t\t\tif (element instanceof window[constructor]) {\r\n\t\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t} else if (element instanceof constructor) {\r\n\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n\t// Use an intermediate object so it errors on incorrect data.\r\n\tconst newData: ElementData = {\r\n\t\ttypes,\r\n\t\tcount: 0,\r\n\t\tcomputedStyle: null,\r\n\t\tcache: {} as any,\r\n\t\tqueueList: {},\r\n\t\tlastAnimationList: {},\r\n\t\tlastFinishList: {},\r\n\t\twindow,\r\n\t};\r\n\r\n\tObject.defineProperty(element, dataName, {\r\n\t\tvalue: newData,\r\n\t});\r\n\r\n\treturn newData;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityState} from \"../../velocity.d\";\r\n\r\n// Constants\r\nimport {CLASSNAME} from \"../constants\";\r\n\r\nconst isClient = window && window === window.window,\r\n\twindowScrollAnchor = isClient && window.pageYOffset !== undefined;\r\n\r\nexport const State: VelocityState = {\r\n\tisClient,\r\n\tisMobile: isClient && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\r\n\tisAndroid: isClient && /Android/i.test(navigator.userAgent),\r\n\tisGingerbread: isClient && /Android 2\\.3\\.[3-7]/i.test(navigator.userAgent),\r\n\tisChrome: isClient && (window as any).chrome,\r\n\tisFirefox: isClient && /Firefox/i.test(navigator.userAgent),\r\n\tprefixElement: isClient && document.createElement(\"div\"),\r\n\twindowScrollAnchor,\r\n\tscrollAnchor: windowScrollAnchor ? window : (!isClient || document.documentElement || document.body.parentNode || document.body),\r\n\tscrollPropertyLeft: windowScrollAnchor ? \"pageXOffset\" : \"scrollLeft\",\r\n\tscrollPropertyTop: windowScrollAnchor ? \"pageYOffset\" : \"scrollTop\",\r\n\tclassName: CLASSNAME,\r\n\tisTicking: false,\r\n\tfirst: undefined,\r\n\tlast: undefined,\r\n\tfirstNew: undefined,\r\n};\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * AnimationCall queue\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, HTMLorSVGElement} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isString} from \"../types\";\r\nimport {addClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Simple queue management. Un-named queue is directly within the element data,\r\n * named queue is within an object within it.\r\n */\r\nfunction animate(animation: AnimationCall) {\r\n\tconst prev = State.last;\r\n\r\n\tanimation._prev = prev;\r\n\tanimation._next = undefined;\r\n\tif (prev) {\r\n\t\tprev._next = animation;\r\n\t} else {\r\n\t\tState.first = animation;\r\n\t}\r\n\tState.last = animation;\r\n\tif (!State.firstNew) {\r\n\t\tState.firstNew = animation;\r\n\t}\r\n\tconst element = animation.element,\r\n\t\tdata = Data(element);\r\n\r\n\tif (!data.count++) {\r\n\r\n\t\t////////////////////////\r\n\t\t// Feature: Classname //\r\n\t\t////////////////////////\r\n\r\n\t\taddClass(element, State.className);\r\n\t}\r\n}\r\n\r\n/**\r\n * Add an item to an animation queue.\r\n */\r\nexport function queue(element: HTMLorSVGElement, animation: AnimationCall, queueName: string | false): void {\r\n\tconst data = Data(element);\r\n\r\n\tif (queueName !== false) {\r\n\t\t// Store the last animation added so we can use it for the\r\n\t\t// beginning of the next one.\r\n\t\tdata.lastAnimationList[queueName] = animation;\r\n\t}\r\n\tif (queueName === false) {\r\n\t\tanimate(animation);\r\n\t} else {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tlet last = data.queueList[queueName];\r\n\r\n\t\tif (!last) {\r\n\t\t\tif (last === null) {\r\n\t\t\t\tdata.queueList[queueName] = animation;\r\n\t\t\t} else {\r\n\t\t\t\tdata.queueList[queueName] = null;\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twhile (last._next) {\r\n\t\t\t\tlast = last._next;\r\n\t\t\t}\r\n\t\t\tlast._next = animation;\r\n\t\t\tanimation._prev = last;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Start the next animation on this element's queue (named or default).\r\n *\r\n * @returns the next animation that is starting.\r\n */\r\nexport function dequeue(element: HTMLorSVGElement, queueName?: string | boolean, skip?: boolean): AnimationCall {\r\n\tif (queueName !== false) {\r\n\t\tif (!isString(queueName)) {\r\n\t\t\tqueueName = \"\";\r\n\t\t}\r\n\t\tconst data = Data(element),\r\n\t\t\tanimation = data.queueList[queueName];\r\n\r\n\t\tif (animation) {\r\n\t\t\tdata.queueList[queueName] = animation._next || null;\r\n\t\t\tif (!skip) {\r\n\t\t\t\tanimate(animation);\r\n\t\t\t}\r\n\t\t} else if (animation === null) {\r\n\t\t\tdelete data.queueList[queueName];\r\n\t\t}\r\n\r\n\t\treturn animation;\r\n\t}\r\n}\r\n\r\n/**\r\n * Remove an animation from the active animation list. If it has a queue set\r\n * then remember it as the last animation for that queue, and free the one\r\n * that was previously there. If the animation list is completely empty then\r\n * mark us as finished.\r\n */\r\nexport function freeAnimationCall(animation: AnimationCall): void {\r\n\tconst next = animation._next,\r\n\t\tprev = animation._prev,\r\n\t\tqueueName = animation.queue == null ? animation.options.queue : animation.queue;\r\n\r\n\tif (State.firstNew === animation) {\r\n\t\tState.firstNew = next;\r\n\t}\r\n\tif (State.first === animation) {\r\n\t\tState.first = next;\r\n\t} else if (prev) {\r\n\t\tprev._next = next;\r\n\t}\r\n\tif (State.last === animation) {\r\n\t\tState.last = prev;\r\n\t} else if (next) {\r\n\t\tnext._prev = prev;\r\n\t}\r\n\tif (queueName) {\r\n\t\tconst data = Data(animation.element);\r\n\r\n\t\tif (data) {\r\n\t\t\tanimation._next = animation._prev = undefined;\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Call Completion\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityCallback} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {getValue, removeClass} from \"../utility\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {dequeue, freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\n\r\n/**\r\n * Call the complete method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callComplete(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.complete as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Complete an animation. This might involve restarting (for loop or repeat\r\n * options). Once it is finished we also check for any callbacks or Promises\r\n * that need updating.\r\n */\r\nexport function completeCall(activeCall: AnimationCall) {\r\n\t// TODO: Check if it's not been completed already\r\n\tconst options = activeCall.options,\r\n\t\tqueue = getValue(activeCall.queue, options.queue),\r\n\t\tisLoop = getValue(activeCall.loop, options.loop, defaults.loop),\r\n\t\tisRepeat = getValue(activeCall.repeat, options.repeat, defaults.repeat),\r\n\t\tisStopped = activeCall._flags & AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\r\n\tif (!isStopped && (isLoop || isRepeat)) {\r\n\r\n\t\t////////////////////\r\n\t\t// Option: Loop //\r\n\t\t// Option: Repeat //\r\n\t\t////////////////////\r\n\r\n\t\tif (isRepeat && isRepeat !== true) {\r\n\t\t\tactiveCall.repeat = isRepeat - 1;\r\n\t\t} else if (isLoop && isLoop !== true) {\r\n\t\t\tactiveCall.loop = isLoop - 1;\r\n\t\t\tactiveCall.repeat = getValue(activeCall.repeatAgain, options.repeatAgain, defaults.repeatAgain);\r\n\t\t}\r\n\t\tif (isLoop) {\r\n\t\t\tactiveCall._flags ^= AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\tif (queue !== false) {\r\n\t\t\t// Can't be called when stopped so no need for an extra check.\r\n\t\t\tData(activeCall.element).lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t}\r\n\t\tactiveCall.timeStart = activeCall.ellapsedTime = activeCall.percentComplete = 0;\r\n\t\tactiveCall._flags &= ~AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t} else {\r\n\t\tconst element = activeCall.element,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (!--data.count && !isStopped) {\r\n\r\n\t\t\t////////////////////////\r\n\t\t\t// Feature: Classname //\r\n\t\t\t////////////////////////\r\n\r\n\t\t\tremoveClass(element, State.className);\r\n\t\t}\r\n\r\n\t\t//////////////////////\r\n\t\t// Option: Complete //\r\n\t\t//////////////////////\r\n\r\n\t\t// If this is the last animation in this list then we can check for\r\n\t\t// and complete calls or Promises.\r\n\t\t// TODO: When deleting an element we need to adjust these values.\r\n\t\tif (options && ++options._completed === options._total) {\r\n\t\t\tif (!isStopped && options.complete) {\r\n\t\t\t\t// We don't call the complete if the animation is stopped,\r\n\t\t\t\t// and we clear the key to prevent it being called again.\r\n\t\t\t\tcallComplete(activeCall);\r\n\t\t\t\toptions.complete = null;\r\n\t\t\t}\r\n\t\t\tconst resolver = options._resolver;\r\n\r\n\t\t\tif (resolver) {\r\n\t\t\t\t// Fulfil the Promise\r\n\t\t\t\tresolver(activeCall.elements as any);\r\n\t\t\t\tdelete options._resolver;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t///////////////////\r\n\t\t// Option: Queue //\r\n\t\t///////////////////\r\n\r\n\t\tif (queue !== false) {\r\n\t\t\t// We only do clever things with queues...\r\n\t\t\tif (!isStopped) {\r\n\t\t\t\t// If we're not stopping an animation, we need to remember\r\n\t\t\t\t// what time it finished so that the next animation in\r\n\t\t\t\t// sequence gets the correct start time.\r\n\t\t\t\tdata.lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\r\n\t\t\t}\r\n\t\t\t// Start the next animation in sequence, or delete the queue if\r\n\t\t\t// this was the last one.\r\n\t\t\tdequeue(element, queue);\r\n\t\t}\r\n\t\t// Cleanup any pointers, and remember the last animation etc.\r\n\t\tfreeAnimationCall(activeCall);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Normalisations are used when getting or setting a (normally css compound\r\n * properties) value that can have a different order in different browsers.\r\n *\r\n * It can also be used to extend and create specific properties that otherwise\r\n * don't exist (such as for scrolling, or inner/outer dimensions).\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../types\";\r\nimport {registerAction} from \"../actions/actions\";\r\nimport {Data} from \"../data\";\r\nimport {ClassConstructor, constructorCache, constructors, NoCacheNormalizations, Normalizations, NormalizationUnits} from \"./normalizationsObject\";\r\n\r\n/**\r\n * Used to register a normalization. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerNormalization\", \"Element\", \"name\", VelocityNormalizationsFn[, false]);\r\n *\r\n * The second argument is the class of the animatable object. If this is passed\r\n * as a class name (ie, `\"Element\"` -> `window[\"Element\"]`) then this will work\r\n * cross-iframe. If passed as an actual class (ie `Element`) then it will\r\n * attempt to find the class on the window and use that name instead. If it\r\n * can't find it then it will use the class passed, which allows for custom\r\n * animation targets, but will not work cross-iframe boundary.\r\n *\r\n * The fourth argument can be an explicit false, which prevents\r\n * the property from being cached. Please note that this can be dangerous\r\n * for performance!\r\n */\r\nexport function registerNormalization(\r\n\targs?: [ClassConstructor | string, string, VelocityNormalizationsFn]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, boolean]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string]\r\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string, boolean]) {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1],\r\n\t\tcallback = args[2];\r\n\r\n\tif ((isString(constructor) && !(window[constructor] instanceof Object))\r\n\t\t|| (!isString(constructor) && !(constructor instanceof Object))) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' constructor to an invalid value:`, constructor);\r\n\t} else if (!isString(name)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' name to an invalid value:`, name);\r\n\t} else if (!isFunction(callback)) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' callback to an invalid value:`, name, callback);\r\n\t} else {\r\n\t\tlet index = constructors.indexOf(constructor),\r\n\t\t\tnextArg = 3;\r\n\r\n\t\tif (index < 0 && !isString(constructor)) {\r\n\t\t\tif (constructorCache.has(constructor)) {\r\n\t\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t\t} else {\r\n\t\t\t\tfor (const property in window) {\r\n\t\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t\t\tindex = constructors.push(property) - 1;\r\n\t\t\t\t\t\t\tNormalizations[index] = {};\r\n\t\t\t\t\t\t\tconstructorCache.set(constructor, property);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (index < 0) {\r\n\t\t\tindex = constructors.push(constructor) - 1;\r\n\t\t\tNormalizations[index] = {};\r\n\t\t}\r\n\t\tNormalizations[index][name] = callback;\r\n\t\tif (isString(args[nextArg])) {\r\n\t\t\tconst unit = args[nextArg++] as string;\r\n\t\t\tlet units = NormalizationUnits[unit];\r\n\r\n\t\t\tif (!units) {\r\n\t\t\t\tunits = NormalizationUnits[unit] = [];\r\n\t\t\t}\r\n\t\t\tunits.push(callback);\r\n\t\t}\r\n\t\tif (args[nextArg] === false) {\r\n\t\t\tNoCacheNormalizations.add(name);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to check if a normalisation exists on a specific class.\r\n */\r\nexport function hasNormalization(args?: [ClassConstructor | string, string]): boolean {\r\n\tconst constructor = args[0],\r\n\t\tname: string = args[1];\r\n\tlet index = constructors.indexOf(constructor);\r\n\r\n\tif (index < 0 && !isString(constructor)) {\r\n\t\tif (constructorCache.has(constructor)) {\r\n\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\r\n\t\t} else {\r\n\t\t\tfor (const property in window) {\r\n\t\t\t\tif (window[property] === constructor) {\r\n\t\t\t\t\tindex = constructors.indexOf(property);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn index >= 0 && Normalizations[index].hasOwnProperty(name);\r\n}\r\n\r\n/**\r\n * Get the unit to add to a unitless number based on the normalization used.\r\n */\r\nexport function getNormalizationUnit(fn: VelocityNormalizationsFn) {\r\n\tfor (const unit in NormalizationUnits) {\r\n\t\tif (NormalizationUnits[unit].includes(fn)) {\r\n\t\t\treturn unit;\r\n\t\t}\r\n\t}\r\n\r\n\treturn \"\";\r\n}\r\n\r\n/**\r\n * Get the normalization for an element and propertyName combination. This\r\n * value should be cached at asking time, as it may change if the user adds\r\n * more normalizations.\r\n */\r\nexport function getNormalization(element: HTMLorSVGElement, propertyName: string) {\r\n\tconst data = Data(element);\r\n\tlet fn: VelocityNormalizationsFn;\r\n\r\n\tfor (let index = constructors.length - 1, types = data.types; !fn && index >= 0; index--) {\r\n\t\tif (types & (1 << index)) { // tslint:disable-line:no-bitwise\r\n\t\t\tfn = Normalizations[index][propertyName];\r\n\t\t}\r\n\t}\r\n\r\n\treturn fn;\r\n}\r\n\r\nregisterAction([\"registerNormalization\", registerNormalization]);\r\nregisterAction([\"hasNormalization\", hasNormalization]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\n\r\n/**\r\n * The singular setPropertyValue, which routes the logic for all\r\n * normalizations.\r\n */\r\nexport function setPropertyValue(element: HTMLorSVGElement, propertyName: string, propertyValue: any, fn?: VelocityNormalizationsFn) {\r\n\tconst noCache = NoCacheNormalizations.has(propertyName),\r\n\t\tdata = !noCache && Data(element);\r\n\r\n\tif (noCache || (data && data.cache[propertyName] !== propertyValue)) {\r\n\t\t// By setting it to undefined we force a true \"get\" later\r\n\t\tif (!noCache) {\r\n\t\t\tdata.cache[propertyName] = propertyValue || undefined;\r\n\t\t}\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tfn(element, propertyValue);\r\n\t\t}\r\n\t\tif (Velocity.debug >= 2) {\r\n\t\t\tconsole.info(`Set \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t\t}\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n/**\r\n * Cache every camelCase match to avoid repeating lookups.\r\n */\r\nconst cache: {[property: string]: string} = {};\r\n\r\n/**\r\n * Camelcase a property name into its JavaScript notation (e.g.\r\n * \"background-color\" ==> \"backgroundColor\"). Camelcasing is used to\r\n * normalize property names between and across calls.\r\n */\r\nexport function camelCase(property: string): string {\r\n\tconst fixed = cache[property];\r\n\r\n\tif (fixed) {\r\n\t\treturn fixed;\r\n\t}\r\n\r\n\treturn cache[property] = property.replace(/-([a-z])/g, ($: string, letter: string) => letter.toUpperCase());\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Constants\r\nconst rxColor6 = /#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/gi,\r\n\trxColor3 = /#([a-f\\d])([a-f\\d])([a-f\\d])/gi,\r\n\trxColorName = /(rgba?\\(\\s*)?(\\b[a-z]+\\b)/g,\r\n\trxRGB = /rgb(a?)\\(([^\\)]+)\\)/gi,\r\n\trxSpaces = /\\s+/g;\r\n\r\n/**\r\n * This is the list of color names -> rgb values. The object is in here so\r\n * that the actual name conversion can be in a separate file and not\r\n * included for custom builds.\r\n */\r\nexport const ColorNames: {[name: string]: string} = {};\r\n\r\n/**\r\n * Convert a hex list to an rgba value. Designed to be used in replace.\r\n */\r\nfunction makeRGBA(ignore: any, r: string, g: string, b: string): string {\r\n\treturn `rgba(${parseInt(r, 16)},${parseInt(g, 16)},${parseInt(b, 16)},1)`;\r\n}\r\n\r\n/**\r\n * Replace any css colour name with its rgba() value. It is possible to use\r\n * the name within an \"rgba(blue, 0.4)\" string this way.\r\n */\r\nexport function fixColors(str: string): string {\r\n\treturn str\r\n\t\t.replace(rxColor6, makeRGBA)\r\n\t\t.replace(rxColor3, ($0, r, g, b) => {\r\n\t\t\treturn makeRGBA($0, r + r, g + g, b + b);\r\n\t\t})\r\n\t\t.replace(rxColorName, ($0, $1, $2) => {\r\n\t\t\tif (ColorNames[$2]) {\r\n\t\t\t\treturn ($1 ? $1 : \"rgba(\") + ColorNames[$2] + ($1 ? \"\" : \",1)\");\r\n\t\t\t}\r\n\r\n\t\t\treturn $0;\r\n\t\t})\r\n\t\t.replace(rxRGB, ($0, $1, $2: string) => {\r\n\t\t\treturn `rgba(${$2.replace(rxSpaces, \"\") + ($1 ? \"\" : \",1\")})`;\r\n\t\t});\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"./getPropertyValue\";\r\n\r\n/**\r\n * Figure out the dimensions for this width / height based on the\r\n * potential borders and whether we care about them.\r\n */\r\nexport function augmentDimension(element: HTMLorSVGElement, name: \"width\" | \"height\", wantInner: boolean): number {\r\n\tconst isBorderBox = getPropertyValue(element, \"boxSizing\")\r\n\t\t.toString()\r\n\t\t.toLowerCase() === \"border-box\";\r\n\r\n\tif (isBorderBox === wantInner) {\r\n\t\t// in box-sizing mode, the CSS width / height accessors already\r\n\t\t// give the outerWidth / outerHeight.\r\n\t\tconst sides = name === \"width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\r\n\t\t\tfields = [`padding${sides[0]}`, `padding${sides[1]}`, `border${sides[0]}Width`, `border${sides[1]}Width`];\r\n\t\tlet augment = 0;\r\n\r\n\t\tfor (const field of fields) {\r\n\t\t\tconst value = parseFloat(getPropertyValue(element, field));\r\n\r\n\t\t\tif (!isNaN(value)) {\r\n\t\t\t\taugment += value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn wantInner ? -augment : augment;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport Velocity from \"../../velocity\";\r\nimport {Data} from \"../data\";\r\nimport {getNormalization} from \"../normalizations/normalizations\";\r\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\r\nimport {augmentDimension} from \"./augmentDimension\";\r\nimport {setPropertyValue} from \"./setPropertyValue\";\r\n\r\n/**\r\n * Get the width or height of an element, pulled out as it can be used when the\r\n * in two locations so don't want to repeat it.\r\n */\r\nfunction getWidthHeight(element: HTMLorSVGElement, property: \"width\" | \"height\"): string {\r\n\treturn (element.getBoundingClientRect()[property] + augmentDimension(element, property, true)) + \"px\";\r\n}\r\n\r\n// TODO: This is still a complete mess\r\nexport function computePropertyValue(element: HTMLorSVGElement, property: string): string {\r\n\tconst data = Data(element),\r\n\t\t// If computedStyle is cached, use it. If not then get the correct one\r\n\t\t// for the element to support cross-iframe boundaries.\r\n\t\tcomputedStyle = data.computedStyle ? data.computedStyle : data.window.getComputedStyle(element, null);\r\n\tlet computedValue: string | number = 0;\r\n\r\n\tif (!data.computedStyle) {\r\n\t\tdata.computedStyle = computedStyle;\r\n\t}\r\n\tif (computedStyle[\"display\"] === \"none\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\t// Browsers do not return height and width values for elements\r\n\t\t\t\t// that are set to display:\"none\". Thus, we temporarily toggle\r\n\t\t\t\t// display to the element type's default value.\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"auto\");\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tsetPropertyValue(element, \"display\", \"none\");\r\n\r\n\t\t\t\treturn String(computedValue);\r\n\t\t}\r\n\t}\r\n\r\n\t/* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\r\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\r\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\r\n\t/* TODO: There is a borderColor normalisation in legacy/ - figure out where this is needed... */\r\n\r\n\tcomputedValue = computedStyle[property];\r\n\t/* Fall back to the property's style value (if defined) when computedValue returns nothing,\r\n\t which can happen when the element hasn't been painted. */\r\n\tif (!computedValue) {\r\n\t\tcomputedValue = element.style[property];\r\n\t}\r\n\t/* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\r\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\r\n\t effect as being set to 0, so no conversion is necessary.) */\r\n\t/* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\r\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\r\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\r\n\tif (computedValue === \"auto\") {\r\n\t\tswitch (property) {\r\n\t\t\tcase \"width\":\r\n\t\t\tcase \"height\":\r\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"top\":\r\n\t\t\tcase \"left\":\r\n\t\t\t\tconst topLeft = true;\r\n\t\t\tcase \"right\":\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tconst position = getPropertyValue(element, \"position\");\r\n\r\n\t\t\t\tif (position === \"fixed\" || (topLeft && position === \"absolute\")) {\r\n\t\t\t\t\t// Note: this has no pixel unit on its returned values,\r\n\t\t\t\t\t// we re-add it here to conform with\r\n\t\t\t\t\t// computePropertyValue's behavior.\r\n\t\t\t\t\tcomputedValue = element.getBoundingClientRect[property] + \"px\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t// Deliberate fallthrough!\r\n\t\t\tdefault:\r\n\t\t\t\tcomputedValue = \"0px\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn computedValue ? String(computedValue) : \"\";\r\n}\r\n\r\n/**\r\n * Get a property value. This will grab via the cache if it exists, then\r\n * via any normalisations.\r\n */\r\nexport function getPropertyValue(element: HTMLorSVGElement, propertyName: string, fn?: VelocityNormalizationsFn, skipCache?: boolean): string {\r\n\tconst data = Data(element);\r\n\tlet propertyValue: string;\r\n\r\n\tif (NoCacheNormalizations.has(propertyName)) {\r\n\t\tskipCache = true;\r\n\t}\r\n\tif (!skipCache && data && data.cache[propertyName] != null) {\r\n\t\tpropertyValue = data.cache[propertyName];\r\n\t} else {\r\n\t\tfn = fn || getNormalization(element, propertyName);\r\n\t\tif (fn) {\r\n\t\t\tpropertyValue = fn(element);\r\n\t\t\tif (data) {\r\n\t\t\t\tdata.cache[propertyName] = propertyValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (Velocity.debug >= 2) {\r\n\t\tconsole.info(`Get \"${propertyName}\": \"${propertyValue}\"`, element);\r\n\t}\r\n\r\n\treturn propertyValue;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tweens\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, Sequence,\r\n\tVelocityProperty, VelocityPropertyFn, VelocityPropertyValueFn, VelocityTween,\r\n} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isNumber, isString} from \"../types\";\r\nimport {cloneArray, getValue} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {fixColors} from \"./css/fixColors\";\r\nimport {getPropertyValue} from \"./css/getPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {Easings} from \"./easing/easings\";\r\nimport {getNormalization, getNormalizationUnit} from \"./normalizations/normalizations\";\r\nimport {validateEasing} from \"./options\";\r\nimport {State} from \"./state\";\r\n\r\n// Constants\r\nconst rxHex = /^#([A-f\\d]{3}){1,2}$/i,\r\n\tcommands: {\r\n\t\t[type: string]: (\r\n\t\t\tvalue: any,\r\n\t\t\telement: HTMLorSVGElement,\r\n\t\t\telements: HTMLorSVGElement[],\r\n\t\t\telementArrayIndex: number,\r\n\t\t\tpropertyName: string,\r\n\t\t\ttween: VelocityTween) => string;\r\n\t} = {\r\n\t\t\tfunction: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn (value as any as VelocityPropertyValueFn).call(element, elementArrayIndex, elements.length);\r\n\t\t\t},\r\n\t\t\tnumber: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn String(value) + getNormalizationUnit(tween.fn);\r\n\t\t\t},\r\n\t\t\tstring: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(value);\r\n\t\t\t},\r\n\t\t\tundefined: (value, element, elements, elementArrayIndex, propertyName, tween) => {\r\n\t\t\t\treturn fixColors(getPropertyValue(element, propertyName, tween.fn) || \"\");\r\n\t\t\t},\r\n\t\t};\r\n\r\n/**\r\n * Expand a VelocityProperty argument into a valid sparse Tween array. This\r\n * pre-allocates the array as it is then the correct size and slightly\r\n * faster to access.\r\n */\r\nexport function expandProperties(animation: AnimationCall, properties: Properties) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telements = animation.elements,\r\n\t\telement = animation.element,\r\n\t\telementArrayIndex = elements.indexOf(element),\r\n\t\tdata = Data(element),\r\n\t\tqueue = getValue(animation.queue, animation.options.queue),\r\n\t\tduration = getValue(animation.options.duration, defaults.duration);\r\n\r\n\tfor (const property in properties) {\r\n\t\tif (properties.hasOwnProperty(property)) {\r\n\t\t\tconst propertyName = camelCase(property),\r\n\t\t\t\tfn = getNormalization(element, propertyName);\r\n\t\t\tlet valueData = properties[property];\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (valueData == null) {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to no value supplied.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst tween: VelocityTween = tweens[propertyName] = {} as any;\r\n\t\t\tlet endValue: string,\r\n\t\t\t\tstartValue: string;\r\n\r\n\t\t\ttween.fn = fn;\r\n\t\t\tif (isFunction(valueData)) {\r\n\t\t\t\t// If we have a function as the main argument then resolve\r\n\t\t\t\t// it first, in case it returns an array that needs to be\r\n\t\t\t\t// split.\r\n\t\t\t\tvalueData = (valueData as VelocityPropertyFn).call(element, elementArrayIndex, elements.length, elements);\r\n\t\t\t}\r\n\t\t\tif (Array.isArray(valueData)) {\r\n\t\t\t\t// valueData is an array in the form of\r\n\t\t\t\t// [ endValue, [, easing] [, startValue] ]\r\n\t\t\t\tconst arr1 = valueData[1],\r\n\t\t\t\t\tarr2 = valueData[2];\r\n\r\n\t\t\t\tendValue = valueData[0] as any;\r\n\t\t\t\tif ((isString(arr1) && (/^[\\d-]/.test(arr1) || rxHex.test(arr1))) || isFunction(arr1) || isNumber(arr1)) {\r\n\t\t\t\t\tstartValue = arr1 as any;\r\n\t\t\t\t} else if ((isString(arr1) && Easings[arr1]) || Array.isArray(arr1)) {\r\n\t\t\t\t\ttween.easing = validateEasing(arr1, duration);\r\n\t\t\t\t\tstartValue = arr2 as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstartValue = arr1 || arr2 as any;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tendValue = valueData as any;\r\n\t\t\t}\r\n\t\t\ttween.end = commands[typeof endValue](endValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\tif (startValue != null || (queue === false || data.queueList[queue] === undefined)) {\r\n\t\t\t\ttween.start = commands[typeof startValue](startValue, element, elements, elementArrayIndex, propertyName, tween) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// TODO: Needs a better match for \"translate3d\" etc - a number must be preceded by some form of break...\r\nconst rxToken = /((?:[+\\-*/]=)?(?:[+-]?\\d*\\.\\d+|[+-]?\\d+)[a-z%]*|(?:.(?!$|[+-]?\\d|[+\\-*/]=[+-]?\\d))+.|.)/g,\r\n\trxNumber = /^([+\\-*/]=)?([+-]?\\d*\\.\\d+|[+-]?\\d+)(.*)$/;\r\n\r\n/**\r\n * Find a pattern between multiple strings, return a VelocitySequence with\r\n * the pattern and the tokenised values.\r\n *\r\n * If number then animate.\r\n * If a string then must match.\r\n * If units then convert between them by wrapping in a calc().\r\n * - If already in a calc then nest another layer.\r\n * If in an rgba() then the first three numbers are rounded.\r\n */\r\nexport function findPattern(parts: ReadonlyArray, propertyName: string): Sequence {\r\n\tconst partsLength = parts.length,\r\n\t\ttokens: string[][] = [],\r\n\t\tindexes: number[] = [];\r\n\tlet numbers: boolean;\r\n\r\n\t// First tokenise the strings - these have all values, we will pull\r\n\t// numbers later.\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tif (isString(parts[part])) {\r\n\t\t\ttokens[part] = cloneArray(parts[part].match(rxToken));\r\n\t\t\tindexes[part] = 0;\r\n\t\t\t// If it matches more than one thing then we've got a number.\r\n\t\t\tnumbers = numbers || tokens[part].length > 1;\r\n\t\t\t//console.log(`tokens:`, parts[part], tokens[part])\r\n\t\t} else {\r\n\t\t\t// We have an incomplete lineup, it will get tried again later...\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tconst sequence: Sequence = [] as any,\r\n\t\tpattern = (sequence.pattern = []) as (string | boolean)[],\r\n\t\taddString = (text: string) => {\r\n\t\t\tif (isString(pattern[pattern.length - 1])) {\r\n\t\t\t\tpattern[pattern.length - 1] += text;\r\n\t\t\t} else if (text) {\r\n\t\t\t\tpattern.push(text);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\treturnStringType = () => {\r\n\t\t\tif (numbers || pattern.length > 1) {\r\n\t\t\t\t//console.error(`Velocity: Trying to pattern match mis-matched strings \"${propertyName}\":`, parts);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst isDisplay = propertyName === \"display\",\r\n\t\t\t\tisVisibility = propertyName === \"visibility\";\r\n\r\n\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\tconst value = parts[part];\r\n\r\n\t\t\t\tsequence[part][0] = value;\r\n\t\t\t\t// Don't care about duration...\r\n\t\t\t\tsequence[part].easing = validateEasing((isDisplay && value === \"none\") || (isVisibility && value === \"hidden\") || (!isDisplay && !isVisibility) ? \"at-end\" : \"at-start\", 400);\r\n\t\t\t}\r\n\t\t\tpattern[0] = false;\r\n\r\n\t\t\treturn sequence;\r\n\t\t};\r\n\tlet more = true;\r\n\r\n\tfor (let part = 0; part < partsLength; part++) {\r\n\t\tsequence[part] = [];\r\n\t}\r\n\twhile (more) {\r\n\t\tconst bits: ([number, string] | [number, string, boolean])[] = [],\r\n\t\t\tunits: string[] = [];\r\n\t\tlet text: string,\r\n\t\t\tisUnitless = false,\r\n\t\t\thasNumbers = false;\r\n\r\n\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\tconst index = indexes[part]++,\r\n\t\t\t\ttoken = tokens[part][index];\r\n\r\n\t\t\tif (token) {\r\n\t\t\t\tconst num = token.match(rxNumber); // [ignore, change, number, unit]\r\n\r\n\t\t\t\tif (num) {\r\n\t\t\t\t\t// It's a number, possibly with a += change and unit.\r\n\t\t\t\t\tif (text) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst digits = parseFloat(num[2]),\r\n\t\t\t\t\t\tunit = num[3],\r\n\t\t\t\t\t\tchange = num[1] ? num[1][0] + unit : undefined,\r\n\t\t\t\t\t\tchangeOrUnit = change || unit;\r\n\r\n\t\t\t\t\tif (!units.includes(changeOrUnit)) {\r\n\t\t\t\t\t\t// Will be an empty string at the least.\r\n\t\t\t\t\t\tunits.push(changeOrUnit);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!unit) {\r\n\t\t\t\t\t\tif (digits) {\r\n\t\t\t\t\t\t\thasNumbers = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tisUnitless = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbits[part] = change ? [digits, changeOrUnit, true] : [digits, changeOrUnit];\r\n\t\t\t\t} else if (bits.length) {\r\n\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// It's a string.\r\n\t\t\t\t\tif (!text) {\r\n\t\t\t\t\t\ttext = token;\r\n\t\t\t\t\t} else if (text !== token) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!part) {\r\n\t\t\t\tfor (; part < partsLength; part++) {\r\n\t\t\t\t\tconst index2 = indexes[part]++;\r\n\r\n\t\t\t\t\tif (tokens[part][index2]) {\r\n\t\t\t\t\t\treturn returnStringType();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// IMPORTANT: This is the exit point.\r\n\t\t\t\tmore = false;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t// Different\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (text) {\r\n\t\t\taddString(text);\r\n\t\t} else if (units.length) {\r\n\t\t\tif (units.length === 2 && isUnitless && !hasNumbers) {\r\n\t\t\t\t// If we only have two units, and one is empty, and it's only empty on \"0\", then treat us as having one unit\r\n\t\t\t\tunits.splice(units[0] ? 1 : 0, 1);\r\n\t\t\t}\r\n\t\t\tif (units.length === 1) {\r\n\t\t\t\t// All the same units, so append number then unit.\r\n\t\t\t\tconst unit = units[0],\r\n\t\t\t\t\tfirstLetter = unit[0];\r\n\r\n\t\t\t\tswitch (firstLetter) {\r\n\t\t\t\t\tcase \"+\":\r\n\t\t\t\t\tcase \"-\":\r\n\t\t\t\t\tcase \"*\":\r\n\t\t\t\t\tcase \"/\":\r\n\t\t\t\t\t\tif (propertyName) {\r\n\t\t\t\t\t\t\tconsole.error(`Velocity: The first property must not contain a relative function \"${propertyName}\":`, parts);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tpattern.push(false);\r\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t(sequence[part] as any[]).push(bits[part][0]);\r\n\t\t\t\t}\r\n\t\t\t\taddString(unit);\r\n\t\t\t} else {\r\n\t\t\t\t// Multiple units, so must be inside a calc.\r\n\t\t\t\taddString(\"calc(\");\r\n\t\t\t\tconst patternCalc = pattern.length - 1; // Store the beginning of our calc.\r\n\r\n\t\t\t\tfor (let i = 0; i < units.length; i++) {\r\n\t\t\t\t\tconst unit = units[i],\r\n\t\t\t\t\t\tfirstLetter = unit[0],\r\n\t\t\t\t\t\tisComplex = firstLetter === \"*\" || firstLetter === \"/\",\r\n\t\t\t\t\t\tisMaths = isComplex || firstLetter === \"+\" || firstLetter === \"-\";\r\n\r\n\t\t\t\t\tif (isComplex) {\r\n\t\t\t\t\t\t// TODO: Not sure this should be done automatically!\r\n\t\t\t\t\t\tpattern[patternCalc] += \"(\";\r\n\t\t\t\t\t\taddString(\")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i) {\r\n\t\t\t\t\t\taddString(` ${isMaths ? firstLetter : \"+\"} `);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpattern.push(false);\r\n\t\t\t\t\tfor (let part = 0; part < partsLength; part++) {\r\n\t\t\t\t\t\tconst bit = bits[part],\r\n\t\t\t\t\t\t\tvalue = bit[1] === unit\r\n\t\t\t\t\t\t\t\t? bit[0]\r\n\t\t\t\t\t\t\t\t: bit.length === 3\r\n\t\t\t\t\t\t\t\t\t? sequence[part - 1][sequence[part - 1].length - 1]\r\n\t\t\t\t\t\t\t\t\t: isComplex ? 1 : 0;\r\n\r\n\t\t\t\t\t\t(sequence[part] as any[]).push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\taddString(isMaths ? unit.substring(1) : unit);\r\n\t\t\t\t}\r\n\t\t\t\taddString(\")\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// We've got here, so a valid sequence - now check and fix RGB rounding\r\n\t// and calc() nesting...\r\n\t// TODO: Nested calc(a + calc(b + c)) -> calc(a + (b + c))\r\n\tfor (let i = 0, inRGB = 0; i < pattern.length; i++) {\r\n\t\tconst text = pattern[i];\r\n\r\n\t\tif (isString(text)) {\r\n\t\t\tif (inRGB && (text as string).indexOf(\",\") >= 0) {\r\n\t\t\t\tinRGB++;\r\n\t\t\t} else if ((text as string).indexOf(\"rgb\") >= 0) {\r\n\t\t\t\tinRGB = 1;\r\n\t\t\t}\r\n\t\t} else if (inRGB) {\r\n\t\t\tif (inRGB < 4) {\r\n\t\t\t\tpattern[i] = true;\r\n\t\t\t} else {\r\n\t\t\t\tinRGB = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn sequence;\r\n}\r\n\r\n/**\r\n * Convert a string-based tween with start and end strings, into a pattern\r\n * based tween with arrays.\r\n */\r\nfunction explodeTween(propertyName: string, tween: VelocityTween, duration: number, starting?: boolean) {\r\n\tconst startValue: string = tween.start,\r\n\t\tendValue: string = tween.end;\r\n\r\n\tif (!isString(endValue) || !isString(startValue)) {\r\n\t\treturn;\r\n\t}\r\n\tlet sequence: Sequence = findPattern([startValue, endValue], propertyName);\r\n\r\n\tif (!sequence && starting) {\r\n\t\t// This little piece will take a startValue, split out the\r\n\t\t// various numbers in it, then copy the endValue into the\r\n\t\t// startValue while replacing the numbers in it to match the\r\n\t\t// original start numbers as a repeating sequence.\r\n\t\t// Finally this function will run again with the new\r\n\t\t// startValue and a now matching pattern.\r\n\t\tconst startNumbers = startValue.match(/\\d\\.?\\d*/g) || [\"0\"],\r\n\t\t\tcount = startNumbers.length;\r\n\t\tlet index = 0;\r\n\r\n\t\tsequence = findPattern([endValue.replace(/\\d+\\.?\\d*/g, () => {\r\n\t\t\treturn startNumbers[index++ % count];\r\n\t\t}), endValue], propertyName);\r\n\t}\r\n\tif (sequence) {\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`Velocity: Sequence found:`, sequence);\r\n\t\t}\r\n\t\tsequence[0].percent = 0;\r\n\t\tsequence[1].percent = 1;\r\n\t\ttween.sequence = sequence;\r\n\t\tswitch (tween.easing) {\r\n\t\t\tcase Easings[\"at-start\"]:\r\n\t\t\tcase Easings[\"during\"]:\r\n\t\t\tcase Easings[\"at-end\"]:\r\n\t\t\t\tsequence[0].easing = sequence[1].easing = tween.easing;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Expand all queued animations that haven't gone yet\r\n *\r\n * This will automatically expand the properties map for any recently added\r\n * animations so that the start and end values are correct.\r\n */\r\nexport function validateTweens(activeCall: AnimationCall) {\r\n\t// This might be called on an already-ready animation\r\n\tif (State.firstNew === activeCall) {\r\n\t\tState.firstNew = activeCall._next;\r\n\t}\r\n\t// Check if we're actually already ready\r\n\tif (activeCall._flags & AnimationFlags.EXPANDED) { // tslint:disable-line:no-bitwise\r\n\t\treturn;\r\n\t}\r\n\tconst element = activeCall.element,\r\n\t\ttweens = activeCall.tweens,\r\n\t\tduration = getValue(activeCall.options.duration, defaults.duration);\r\n\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const propertyName in tweens) {\r\n\t\tconst tween = tweens[propertyName];\r\n\r\n\t\tif (tween.start == null) {\r\n\t\t\t// Get the start value as it's not been passed in\r\n\t\t\tconst startValue = getPropertyValue(activeCall.element, propertyName);\r\n\r\n\t\t\tif (isString(startValue)) {\r\n\t\t\t\ttween.start = fixColors(startValue) as any;\r\n\t\t\t\texplodeTween(propertyName, tween, duration, true);\r\n\t\t\t} else if (!Array.isArray(startValue)) {\r\n\t\t\t\tconsole.warn(`bad type`, tween, propertyName, startValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Velocity.debug) {\r\n\t\t\tconsole.log(`tweensContainer \"${propertyName}\": ${JSON.stringify(tween)}`, element);\r\n\t\t}\r\n\t}\r\n\tactiveCall._flags |= AnimationFlags.EXPANDED; // tslint:disable-line:no-bitwise\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Tick\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, TweenStep, VelocityCallback, VelocityProgress} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {now} from \"../utility\";\r\nimport Velocity from \"../velocity\";\r\nimport {completeCall} from \"./complete\";\r\nimport {setPropertyValue} from \"./css/setPropertyValue\";\r\nimport {Data} from \"./data\";\r\nimport {defaults} from \"./defaults\";\r\nimport {linearEasing} from \"./easing/easings\";\r\nimport {freeAnimationCall} from \"./queue\";\r\nimport {State} from \"./state\";\r\nimport {validateTweens} from \"./tweens\";\r\n\r\n/**\r\n * Call the begin method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nexport function callBegin(activeCall: AnimationCall) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements;\r\n\r\n\t\t(activeCall.options.begin as VelocityCallback).call(elements, elements, activeCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\n/**\r\n * Call the progress method of an animation in a separate function so it can\r\n * benefit from JIT compiling while still having a try/catch block.\r\n */\r\nfunction callProgress(activeCall: AnimationCall, timeCurrent: number) {\r\n\ttry {\r\n\t\tconst elements = activeCall.elements,\r\n\t\t\tpercentComplete = activeCall.percentComplete,\r\n\t\t\toptions = activeCall.options,\r\n\t\t\ttweenValue = activeCall.tween;\r\n\r\n\t\t(activeCall.options.progress as VelocityProgress).call(elements,\r\n\t\t\telements,\r\n\t\t\tpercentComplete,\r\n\t\t\tMath.max(0, activeCall.timeStart + (activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaults.duration) - timeCurrent),\r\n\t\t\ttweenValue !== undefined ? tweenValue : String(percentComplete * 100),\r\n\t\t\tactiveCall);\r\n\t} catch (error) {\r\n\t\tsetTimeout(() => {\r\n\t\t\tthrow error;\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\r\nfunction asyncCallbacks() {\r\n\tlet activeCall: AnimationCall,\r\n\t\tnextCall: AnimationCall;\r\n\t// Callbacks and complete that might read the DOM again.\r\n\r\n\t// Progress callback\r\n\tfor (activeCall = firstProgress; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextProgress;\r\n\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\tcallProgress(activeCall, lastTick);\r\n\t}\r\n\t// Complete animations, including complete callback or looping\r\n\tfor (activeCall = firstComplete; activeCall; activeCall = nextCall) {\r\n\t\tnextCall = activeCall._nextComplete;\r\n\t\t/* If this call has finished tweening, pass it to complete() to handle call cleanup. */\r\n\t\tcompleteCall(activeCall);\r\n\t}\r\n}\r\n\r\n/**************\r\n Timing\r\n **************/\r\n\r\nconst FRAME_TIME = 1000 / 60,\r\n\t/**\r\n\t * Shim for window.performance in case it doesn't exist\r\n\t */\r\n\tperformance = (() => {\r\n\t\tconst perf = window.performance || {} as Performance;\r\n\r\n\t\tif (typeof perf.now !== \"function\") {\r\n\t\t\tconst nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : now();\r\n\r\n\t\t\tperf.now = () => {\r\n\t\t\t\treturn now() - nowOffset;\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn perf;\r\n\t})(),\r\n\t/**\r\n\t * Proxy function for when rAF is not available.\r\n\t *\r\n\t * This should hopefully never be used as the browsers often throttle\r\n\t * this to less than one frame per second in the background, making it\r\n\t * completely unusable.\r\n\t */\r\n\trAFProxy = (callback: FrameRequestCallback) => {\r\n\t\treturn setTimeout(callback, Math.max(0, FRAME_TIME - (performance.now() - lastTick)));\r\n\t},\r\n\t/**\r\n\t * Either requestAnimationFrame, or a shim for it.\r\n\t */\r\n\trAFShim = window.requestAnimationFrame || rAFProxy;\r\n\r\n/**\r\n * Set if we are currently inside a tick() to prevent double-calling.\r\n */\r\nlet ticking: boolean,\r\n\t/**\r\n\t * A background WebWorker that sends us framerate messages when we're in\r\n\t * the background. Without this we cannot maintain frame accuracy.\r\n\t */\r\n\tworker: Worker,\r\n\t/**\r\n\t * The first animation with a Progress callback.\r\n\t */\r\n\tfirstProgress: AnimationCall,\r\n\t/**\r\n\t * The first animation with a Complete callback.\r\n\t */\r\n\tfirstComplete: AnimationCall;\r\n\r\n/**\r\n * The time that the last animation frame ran at. Set from tick(), and used\r\n * for missing rAF (ie, when not in focus etc).\r\n */\r\nexport let lastTick: number = 0;\r\n\r\n/**\r\n * WebWorker background function.\r\n *\r\n * When we're in the background this will send us a msg every tick, when in\r\n * the foreground it won't.\r\n *\r\n * When running in the background the browser reduces allowed CPU etc, so\r\n * we raun at 30fps instead of 60fps.\r\n */\r\nfunction workerFn(this: Worker) {\r\n\tlet interval: any;\r\n\r\n\tthis.onmessage = (e) => {\r\n\t\tswitch (e.data) {\r\n\t\t\tcase true:\r\n\t\t\t\tif (!interval) {\r\n\t\t\t\t\tinterval = setInterval(() => {\r\n\t\t\t\t\t\tthis.postMessage(true);\r\n\t\t\t\t\t}, 1000 / 30);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase false:\r\n\t\t\t\tif (interval) {\r\n\t\t\t\t\tclearInterval(interval);\r\n\t\t\t\t\tinterval = 0;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthis.postMessage(e.data);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n}\r\n\r\ntry {\r\n\t// Create the worker - this might not be supported, hence the try/catch.\r\n\tworker = new Worker(URL.createObjectURL(new Blob([`(${workerFn})()`])));\r\n\t// Whenever the worker sends a message we tick()\r\n\tworker.onmessage = (e: MessageEvent) => {\r\n\t\tif (e.data === true) {\r\n\t\t\ttick();\r\n\t\t} else {\r\n\t\t\tasyncCallbacks();\r\n\t\t}\r\n\t};\r\n\t// And watch for going to the background to start the WebWorker running.\r\n\tif (!State.isMobile && document.hidden !== undefined) {\r\n\t\tdocument.addEventListener(\"visibilitychange\", () => {\r\n\t\t\tworker.postMessage(State.isTicking && document.hidden);\r\n\t\t});\r\n\t}\r\n} catch (e) {\r\n\t/*\r\n\t * WebWorkers are not supported in this format. This can happen in IE10\r\n\t * where it can't create one from a blob this way. We fallback, but make\r\n\t * no guarantees towards accuracy in this case.\r\n\t */\r\n}\r\n\r\n/**\r\n * Called on every tick, preferably through rAF. This is reponsible for\r\n * initialising any new animations, then starting any that need starting.\r\n * Finally it will expand any tweens and set the properties relating to\r\n * them. If there are any callbacks relating to the animations then they\r\n * will attempt to call at the end (with the exception of \"begin\").\r\n */\r\nexport function tick(timestamp?: number | boolean) {\r\n\tif (ticking) {\r\n\t\t// Should never happen - but if we've swapped back from hidden to\r\n\t\t// visibile then we want to make sure\r\n\t\treturn;\r\n\t}\r\n\tticking = true;\r\n\t/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\r\n\t We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\r\n\t the browser's next tick sync time occurs, which results in the first elements subjected to Velocity\r\n\t calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore\r\n\t the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated\r\n\t by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */\r\n\tif (timestamp !== false) {\r\n\t\tconst timeCurrent = performance.now(),\r\n\t\t\tdeltaTime = lastTick ? timeCurrent - lastTick : FRAME_TIME,\r\n\t\t\tdefaultSpeed = defaults.speed,\r\n\t\t\tdefaultEasing = defaults.easing,\r\n\t\t\tdefaultDuration = defaults.duration;\r\n\t\tlet activeCall: AnimationCall,\r\n\t\t\tnextCall: AnimationCall,\r\n\t\t\tlastProgress: AnimationCall,\r\n\t\t\tlastComplete: AnimationCall;\r\n\r\n\t\tfirstProgress = null;\r\n\t\tfirstComplete = null;\r\n\t\tif (deltaTime >= defaults.minFrameTime || !lastTick) {\r\n\t\t\tlastTick = timeCurrent;\r\n\r\n\t\t\t/********************\r\n\t\t\t Call Iteration\r\n\t\t\t ********************/\r\n\r\n\t\t\t// Expand any tweens that might need it.\r\n\t\t\twhile (State.firstNew) {\r\n\t\t\t\tvalidateTweens(State.firstNew);\r\n\t\t\t}\r\n\t\t\t// Iterate through each active call.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = activeCall._next) {\r\n\t\t\t\tconst element = activeCall.element,\r\n\t\t\t\t\tdata = Data(element);\r\n\r\n\t\t\t\t// Check to see if this element has been deleted midway\r\n\t\t\t\t// through the animation. If it's gone then end this\r\n\t\t\t\t// animation.\r\n\t\t\t\tif (!element.parentNode || !data) {\r\n\t\t\t\t\t// TODO: Remove safely - decrease count, delete data, remove from arrays\r\n\t\t\t\t\tfreeAnimationCall(activeCall);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tconst options = activeCall.options,\r\n\t\t\t\t\tflags = activeCall._flags;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// If this is the first time that this call has been\r\n\t\t\t\t// processed by tick() then we assign timeStart now so that\r\n\t\t\t\t// it's value is as close to the real animation start time\r\n\t\t\t\t// as possible.\r\n\t\t\t\tif (!timeStart) {\r\n\t\t\t\t\tconst queue = activeCall.queue != null ? activeCall.queue : options.queue;\r\n\r\n\t\t\t\t\ttimeStart = timeCurrent - deltaTime;\r\n\t\t\t\t\tif (queue !== false) {\r\n\t\t\t\t\t\ttimeStart = Math.max(timeStart, data.lastFinishList[queue] || 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall.timeStart = timeStart;\r\n\t\t\t\t}\r\n\t\t\t\t// If this animation is paused then skip processing unless\r\n\t\t\t\t// it has been set to resume.\r\n\t\t\t\tif (flags & AnimationFlags.PAUSED) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// Update the time start to accomodate the paused\r\n\t\t\t\t\t// completion amount.\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// Check if this animation is ready - if it's synced then it\r\n\t\t\t\t// needs to wait for all other animations in the sync\r\n\t\t\t\tif (!(flags & AnimationFlags.READY)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.READY; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\toptions._ready++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Need to split the loop, as ready sync animations must all get\r\n\t\t\t// the same start time.\r\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = nextCall) {\r\n\t\t\t\tconst flags = activeCall._flags;\r\n\r\n\t\t\t\tnextCall = activeCall._next;\r\n\t\t\t\tif (!(flags & AnimationFlags.READY) || (flags & AnimationFlags.PAUSED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst options = activeCall.options;\r\n\r\n\t\t\t\tif ((flags & AnimationFlags.SYNC) && options._ready < options._total) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst speed = activeCall.speed != null ? activeCall.speed : options.speed != null ? options.speed : defaultSpeed;\r\n\t\t\t\tlet timeStart = activeCall.timeStart;\r\n\r\n\t\t\t\t// Don't bother getting until we can use these.\r\n\t\t\t\tif (!(flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t\t\tconst delay = activeCall.delay != null ? activeCall.delay : options.delay;\r\n\r\n\t\t\t\t\t// Make sure anything we've delayed doesn't start\r\n\t\t\t\t\t// animating yet, there might still be an active delay\r\n\t\t\t\t\t// after something has been un-paused\r\n\t\t\t\t\tif (delay) {\r\n\t\t\t\t\t\tif (timeStart + (delay / speed) > timeCurrent) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactiveCall.timeStart = timeStart += delay / (delay > 0 ? speed : 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t\t\t\t// The begin callback is fired once per call, not once\r\n\t\t\t\t\t// per element, and is passed the full raw DOM element\r\n\t\t\t\t\t// set as both its context and its first argument.\r\n\t\t\t\t\tif (options._started++ === 0) {\r\n\t\t\t\t\t\toptions._first = activeCall;\r\n\t\t\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\t\t\tcallBegin(activeCall);\r\n\t\t\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (speed !== 1) {\r\n\t\t\t\t\t// On the first frame we may have a shorter delta\r\n\t\t\t\t\tconst delta = Math.min(deltaTime, timeCurrent - timeStart);\r\n\t\t\t\t\tactiveCall.timeStart = timeStart += delta * (1 - speed);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options._first === activeCall && options.progress) {\r\n\t\t\t\t\tactiveCall._nextProgress = undefined;\r\n\t\t\t\t\tif (lastProgress) {\r\n\t\t\t\t\t\tlastProgress._nextProgress = lastProgress = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstProgress = lastProgress = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst activeEasing = activeCall.easing != null ? activeCall.easing : options.easing != null ? options.easing : defaultEasing,\r\n\t\t\t\t\tmillisecondsEllapsed = activeCall.ellapsedTime = timeCurrent - timeStart,\r\n\t\t\t\t\tduration = activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaultDuration,\r\n\t\t\t\t\tpercentComplete = activeCall.percentComplete = Velocity.mock ? 1 : Math.min(millisecondsEllapsed / duration, 1),\r\n\t\t\t\t\ttweens = activeCall.tweens,\r\n\t\t\t\t\treverse = flags & AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\r\n\r\n\t\t\t\tif (percentComplete === 1) {\r\n\t\t\t\t\tactiveCall._nextComplete = undefined;\r\n\t\t\t\t\tif (lastComplete) {\r\n\t\t\t\t\t\tlastComplete._nextComplete = lastComplete = activeCall;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfirstComplete = lastComplete = activeCall;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const property in tweens) {\r\n\t\t\t\t\t// For every element, iterate through each property.\r\n\t\t\t\t\tconst tween = tweens[property],\r\n\t\t\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\t\t\tpattern = sequence.pattern;\r\n\t\t\t\t\tlet currentValue = \"\",\r\n\t\t\t\t\t\ti = 0;\r\n\r\n\t\t\t\t\tif (pattern) {\r\n\t\t\t\t\t\tconst easingComplete = (tween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\t\t\t\tlet best = 0;\r\n\r\n\t\t\t\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\t\t\t\tbest = j;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\t\t\t\teasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\t\t\t\tconst result = easing(reverse ? 1 - tweenPercent : tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(result) : result;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (property !== \"tween\") {\r\n\t\t\t\t\t\t\tif (percentComplete === 1 && currentValue.startsWith(\"calc(0 + \")) {\r\n\t\t\t\t\t\t\t\tcurrentValue = currentValue.replace(/^calc\\(0[^\\d]* \\+ ([^\\(\\)]+)\\)$/, \"$1\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// TODO: To solve an IE<=8 positioning bug, the unit type must be dropped when setting a property value of 0 - add normalisations to legacy\r\n\t\t\t\t\t\t\tsetPropertyValue(activeCall.element, property, currentValue, tween.fn);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Skip the fake 'tween' property as that is only\r\n\t\t\t\t\t\t\t// passed into the progress callback.\r\n\t\t\t\t\t\t\tactiveCall.tween = currentValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Missing pattern:`, property, JSON.stringify(tween[property]));\r\n\t\t\t\t\t\tdelete tweens[property];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (firstProgress || firstComplete) {\r\n\t\t\t\tif (document.hidden) {\r\n\t\t\t\t\tasyncCallbacks();\r\n\t\t\t\t} else if (worker) {\r\n\t\t\t\t\tworker.postMessage(\"\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(asyncCallbacks, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (State.first) {\r\n\t\tState.isTicking = true;\r\n\t\tif (!document.hidden) {\r\n\t\t\trAFShim(tick);\r\n\t\t} else if (!worker) {\r\n\t\t\trAFProxy(tick);\r\n\t\t} else if (timestamp === false) {\r\n\t\t\t// Make sure we turn on the messages.\r\n\t\t\tworker.postMessage(true);\r\n\t\t}\r\n\t} else {\r\n\t\tState.isTicking = false;\r\n\t\tlastTick = 0;\r\n\t\tif (document.hidden && worker) {\r\n\t\t\t// Make sure we turn off the messages.\r\n\t\t\tworker.postMessage(false);\r\n\t\t}\r\n\t}\r\n\tticking = false;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Finish all animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {callBegin} from \"../tick\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be finished, and if so we set the tweens to\r\n * the final value for it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeFinished(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (!(animation._flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\r\n\t\t\t// Copied from tick.ts - ensure that the animation is completely\r\n\t\t\t// valid and run begin() before complete().\r\n\t\t\tconst options = animation.options;\r\n\r\n\t\t\t// The begin callback is fired once per call, not once per\r\n\t\t\t// element, and is passed the full raw DOM element set as both\r\n\t\t\t// its context and its first argument.\r\n\t\t\tif (options._started++ === 0) {\r\n\t\t\t\toptions._first = animation;\r\n\t\t\t\tif (options.begin) {\r\n\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\r\n\t\t\t\t\tcallBegin(animation);\r\n\t\t\t\t\t// Only called once, even if reversed or repeated\r\n\t\t\t\t\toptions.begin = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tanimation._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t\t// tslint:disable-next-line:forin\r\n\t\tfor (const property in animation.tweens) {\r\n\t\t\tconst tween = animation.tweens[property],\r\n\t\t\t\tsequence = tween.sequence,\r\n\t\t\t\tpattern = sequence.pattern;\r\n\t\t\tlet currentValue = \"\",\r\n\t\t\t\ti = 0;\r\n\r\n\t\t\tif (pattern) {\r\n\t\t\t\tconst endValues = sequence[sequence.length - 1];\r\n\r\n\t\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\t\tconst endValue = endValues[i];\r\n\r\n\t\t\t\t\tcurrentValue += endValue == null ? pattern[i] : endValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetPropertyValue(animation.element, property, currentValue, tween.fn);\r\n\t\t}\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the finish action is triggered, the elements' currently active call is\r\n * immediately finished. When an element is finished, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are finished. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n */\r\nfunction finish(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeFinished(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeFinished(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"finish\", finish], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a value from one or more running animations.\r\n */\r\n\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {\r\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\r\n\tvalidateFpsLimit, validateLoop, validateQueue, validateRepeat,\r\n} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {lastTick} from \"../tick\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Used to map getters for the various AnimationFlags.\r\n */\r\nconst animationFlags: {[key: string]: number} = {\r\n\tisExpanded: AnimationFlags.EXPANDED,\r\n\tisReady: AnimationFlags.READY,\r\n\tisStarted: AnimationFlags.STARTED,\r\n\tisStopped: AnimationFlags.STOPPED,\r\n\tisPaused: AnimationFlags.PAUSED,\r\n\tisSync: AnimationFlags.SYNC,\r\n\tisReverse: AnimationFlags.REVERSE,\r\n};\r\n\r\n/**\r\n * Get or set an option or running AnimationCall data value. If there is no\r\n * value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n */\r\nfunction option(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst key = args[0],\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(queue, true);\r\n\tlet animations: AnimationCall[],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!key) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant key!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// If we're chaining the return value from Velocity then we are only\r\n\t// interested in the values related to that call\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tanimations = elements.velocity.animations;\r\n\t} else {\r\n\t\tanimations = [];\r\n\r\n\t\tfor (let activeCall = State.first; activeCall; activeCall = activeCall._next) {\r\n\t\t\tif (elements.indexOf(activeCall.element) >= 0 && getValue(activeCall.queue, activeCall.options.queue) === queueName) {\r\n\t\t\t\tanimations.push(activeCall);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we're dealing with multiple elements that are pointing at a\r\n\t\t// single running animation, then instead treat them as a single\r\n\t\t// animation.\r\n\t\tif (elements.length > 1 && animations.length > 1) {\r\n\t\t\tlet i = 1,\r\n\t\t\t\toptions = animations[0].options;\r\n\r\n\t\t\twhile (i < animations.length) {\r\n\t\t\t\tif (animations[i++].options !== options) {\r\n\t\t\t\t\toptions = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: this needs to check that they're actually a sync:true animation to merge the results, otherwise the individual values may be different\r\n\t\t\tif (options) {\r\n\t\t\t\tanimations = [animations[0]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// GET\r\n\tif (value === undefined) {\r\n\t\tconst result = [],\r\n\t\t\tflag = animationFlags[key];\r\n\r\n\t\tfor (const animation of animations) {\r\n\t\t\tif (flag === undefined) {\r\n\t\t\t\t// A normal key to get.\r\n\t\t\t\tresult.push(getValue(animation[key], animation.options[key]));\r\n\t\t\t} else {\r\n\t\t\t\t// A flag that we're checking against.\r\n\t\t\t\tresult.push((animation._flags & flag) === 0); // tslint:disable-line:no-bitwise\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (elements.length === 1 && animations.length === 1) {\r\n\t\t\t// If only a single animation is found and we're only targetting a\r\n\t\t\t// single element, then return the value directly\r\n\t\t\treturn result[0];\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tlet isPercentComplete: boolean;\r\n\r\n\tswitch (key) {\r\n\t\tcase \"cache\":\r\n\t\t\tvalue = validateCache(value);\r\n\t\t\tbreak;\r\n\t\tcase \"begin\":\r\n\t\t\tvalue = validateBegin(value);\r\n\t\t\tbreak;\r\n\t\tcase \"complete\":\r\n\t\t\tvalue = validateComplete(value);\r\n\t\t\tbreak;\r\n\t\tcase \"delay\":\r\n\t\t\tvalue = validateDelay(value);\r\n\t\t\tbreak;\r\n\t\tcase \"duration\":\r\n\t\t\tvalue = validateDuration(value);\r\n\t\t\tbreak;\r\n\t\tcase \"fpsLimit\":\r\n\t\t\tvalue = validateFpsLimit(value);\r\n\t\t\tbreak;\r\n\t\tcase \"loop\":\r\n\t\t\tvalue = validateLoop(value);\r\n\t\t\tbreak;\r\n\t\tcase \"percentComplete\":\r\n\t\t\tisPercentComplete = true;\r\n\t\t\tvalue = parseFloat(value);\r\n\t\t\tbreak;\r\n\t\tcase \"repeat\":\r\n\t\tcase \"repeatAgain\":\r\n\t\t\tvalue = validateRepeat(value);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tif (key[0] !== \"_\") {\r\n\t\t\t\tconst num = parseFloat(value);\r\n\r\n\t\t\t\tif (value === String(num)) {\r\n\t\t\t\t\tvalue = num;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t// deliberate fallthrough\r\n\t\tcase \"queue\":\r\n\t\tcase \"promise\":\r\n\t\tcase \"promiseRejectEmpty\":\r\n\t\tcase \"easing\":\r\n\t\tcase \"started\":\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set a read-only key:`, key);\r\n\r\n\t\t\treturn;\r\n\t}\r\n\tif (value === undefined || value !== value) {\r\n\t\tconsole.warn(`VelocityJS: Trying to set an invalid value:${key}=${value} (${args[1]})`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\tfor (const animation of animations) {\r\n\t\tif (isPercentComplete) {\r\n\t\t\tanimation.timeStart = lastTick - (getValue(animation.duration, animation.options.duration, defaults.duration) * value);\r\n\t\t} else {\r\n\t\t\tanimation[key] = value;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"option\", option], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Pause and resume animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be paused / resumed.\r\n */\r\nfunction checkAnimation(animation: AnimationCall, queueName: false | string, defaultQueue: false | string, isPaused: boolean) {\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tif (isPaused) {\r\n\t\t\tanimation._flags |= AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t} else {\r\n\t\t\tanimation._flags &= ~AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Pause and Resume are call-wide (not on a per element basis). Thus, calling pause or resume on a\r\n * single element will cause any calls that contain tweens for that element to be paused/resumed\r\n * as well.\r\n */\r\nfunction pauseResume(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string) {\r\n\tconst isPaused = action.indexOf(\"pause\") === 0,\r\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\r\n\t\tqueueName = queue === \"false\" ? false : validateQueue(args[0]),\r\n\t\tdefaultQueue = defaults.queue;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimation(animation, queueName, defaultQueue, isPaused);\r\n\t\t}\r\n\t} else {\r\n\t\tlet activeCall: AnimationCall = State.first;\r\n\r\n\t\twhile (activeCall) {\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimation(activeCall, queueName, defaultQueue, isPaused);\r\n\t\t\t}\r\n\t\t\tactiveCall = activeCall._next;\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"pause\", pauseResume], true);\r\nregisterAction([\"resume\", pauseResume], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Actions that can be performed by passing a string instead of a propertiesMap.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerAction} from \"./actions\";\r\n\r\nregisterAction([\"reverse\", (args?: any[], elements?: HTMLorSVGElement[] | VelocityResult, promiseHandler?: VelocityPromise, action?: string) => {\r\n\t// NOTE: Code needs to split out before here - but this is needed to prevent it being overridden\r\n\tthrow new SyntaxError(\"VelocityJS: The 'reverse' action is built in and private.\");\r\n}], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Stop animation.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isVelocityResult} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {completeCall} from \"../complete\";\r\nimport {defaults} from \"../defaults\";\r\nimport {validateQueue} from \"../options\";\r\nimport {State} from \"../state\";\r\nimport {validateTweens} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Check if an animation should be stopped, and if so then set the STOPPED\r\n * flag on it, then call complete.\r\n */\r\nfunction checkAnimationShouldBeStopped(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\r\n\tvalidateTweens(animation);\r\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\r\n\t\tanimation._flags |= AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\r\n\t\tcompleteCall(animation);\r\n\t}\r\n}\r\n\r\n/**\r\n * When the stop action is triggered, the elements' currently active call is\r\n * immediately stopped. When an element is stopped, the next item in its\r\n * animation queue is immediately triggered. If passed via a chained call\r\n * then this will only target the animations in that call, and not the\r\n * elements linked to it.\r\n *\r\n * A queue name may be passed in to specify that only animations on the\r\n * named queue are stopped. The default queue is named \"\". In addition the\r\n * value of `false` is allowed for the queue name.\r\n *\r\n * An final argument may be passed in to clear an element's remaining queued\r\n * calls. This may only be the value `true`.\r\n *\r\n * Note: The stop command runs prior to Velocity's Queueing phase since its\r\n * behavior is intended to take effect *immediately*, regardless of the\r\n * element's current queue state.\r\n */\r\nfunction stop(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise, action?: string): void {\r\n\tconst queueName: string | false = validateQueue(args[0], true),\r\n\t\tdefaultQueue: false | string = defaults.queue,\r\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\r\n\r\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\r\n\t\tfor (const animation of elements.velocity.animations) {\r\n\t\t\tcheckAnimationShouldBeStopped(animation, queueName, defaultQueue);\r\n\t\t}\r\n\t} else {\r\n\t\twhile (State.firstNew) {\r\n\t\t\tvalidateTweens(State.firstNew);\r\n\t\t}\r\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\r\n\t\t\tnextCall = activeCall._next;\r\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\r\n\t\t\t\tcheckAnimationShouldBeStopped(activeCall, queueName, defaultQueue);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"stop\", stop], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityPromise, VelocityResult} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString, isVelocityResult} from \"../../types\";\r\nimport {fixColors} from \"../css/fixColors\";\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function style(elements: VelocityResult, property: {[property: string]: string}): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string): string | string[];\r\nexport function style(elements: VelocityResult, property: string, value: string): VelocityResult;\r\nexport function style(elements: VelocityResult, property: string | {[property: string]: string}, value?: string) {\r\n\treturn styleAction([property, value], elements);\r\n}\r\n\r\n/**\r\n * Get or set a style of Nomralised property value on one or more elements.\r\n * If there is no value passed then it will get, otherwise we will set.\r\n *\r\n * NOTE: When using \"get\" this will not touch the Promise as it is never\r\n * returned to the user.\r\n *\r\n * This can fail to set, and will reject the Promise if it does so.\r\n *\r\n * Velocity(elements, \"style\", \"property\", \"value\") => elements;\r\n * Velocity(elements, \"style\", {\"property\": \"value\", ...}) => elements;\r\n * Velocity(element, \"style\", \"property\") => \"value\";\r\n * Velocity(elements, \"style\", \"property\") => [\"value\", ...];\r\n */\r\nfunction styleAction(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\r\n\tconst property = args[0],\r\n\t\tvalue = args[1];\r\n\r\n\tif (!property) {\r\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant property!`);\r\n\r\n\t\treturn null;\r\n\t}\r\n\t// GET\r\n\tif (value === undefined && !isPlainObject(property)) {\r\n\t\t// If only a single animation is found and we're only targetting a\r\n\t\t// single element, then return the value directly\r\n\t\tif (elements.length === 1) {\r\n\t\t\treturn fixColors(getPropertyValue(elements[0], property));\r\n\t\t}\r\n\t\tconst result = [];\r\n\r\n\t\tfor (const element of elements) {\r\n\t\t\tresult.push(fixColors(getPropertyValue(element, property)));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\t// SET\r\n\tconst error: string[] = [];\r\n\r\n\tif (isPlainObject(property)) {\r\n\t\tfor (const propertyName in property) {\r\n\t\t\tif (property.hasOwnProperty(propertyName)) {\r\n\t\t\t\tfor (const element of elements) {\r\n\t\t\t\t\tconst propertyValue = property[propertyName];\r\n\r\n\t\t\t\t\tif (isString(propertyValue) || isNumber(propertyValue)) {\r\n\t\t\t\t\t\tsetPropertyValue(element, propertyName, property[propertyName]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\terror.push(`Cannot set a property \"${propertyName}\" to an unknown type: ${typeof propertyValue}`);\r\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Cannot set a property \"${propertyName}\" to an unknown type:`, propertyValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(value) || isNumber(value)) {\r\n\t\tfor (const element of elements) {\r\n\t\t\tsetPropertyValue(element, property, String(value));\r\n\t\t}\r\n\t} else {\r\n\t\terror.push(`Cannot set a property \"${property}\" to an unknown type: ${typeof value}`);\r\n\t\tconsole.warn(`VelocityJS: Cannot set a property \"${property}\" to an unknown type:`, value);\r\n\t}\r\n\tif (promiseHandler) {\r\n\t\tif (error.length) {\r\n\t\t\tpromiseHandler._rejecter(error.join(\", \"));\r\n\t\t} else if (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\r\n\t\t\telements.then(promiseHandler._resolver);\r\n\t\t} else {\r\n\t\t\tpromiseHandler._resolver(elements);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"style\", styleAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Get or set a property from one or more elements.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, HTMLorSVGElement, Properties, Sequence, SequenceList,\r\n\tTweenStep, VelocityEasingType, VelocityPromise, VelocityProperty,\r\n} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../../types\";\r\nimport {getValue} from \"../../utility\";\r\nimport {defaults} from \"../defaults\";\r\nimport {linearEasing} from \"../easing/easings\";\r\nimport {validateEasing} from \"../options\";\r\nimport {expandSequence} from \"../sequences\";\r\nimport {SequencesObject} from \"../sequencesObject\";\r\nimport {expandProperties} from \"../tweens\";\r\nimport {registerAction} from \"./actions\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../../constants\";\r\n\r\n/**\r\n * Expose a style shortcut - can't be used with chaining, but might be of\r\n * use to people.\r\n */\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, properties: Properties, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], percentComplete: number, propertyName: string, property: VelocityProperty, easing?: VelocityEasingType);\r\nexport function tween(elements: HTMLorSVGElement[], ...args: any[]) {\r\n\treturn tweenAction(arguments as any, elements);\r\n}\r\n\r\n/**\r\n *\r\n */\r\nfunction tweenAction(args?: any[], elements?: HTMLorSVGElement[], promiseHandler?: VelocityPromise, action?: string): any {\r\n\tlet requireForcefeeding: boolean;\r\n\r\n\tif (!elements) {\r\n\t\tif (!args.length) {\r\n\t\t\tconsole.info(`Velocity(, \\\"tween\\\", percentComplete, property, end | [end, , ], ) => value\r\nVelocity(, \\\"tween\\\", percentComplete, {property: end | [end, , ], ...}, ) => {property: value, ...}`);\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\telements = [document.body];\r\n\t\trequireForcefeeding = true;\r\n\t} else if (elements.length !== 1) {\r\n\t\t// TODO: Allow more than a single element to return an array of results\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween more than one element!\");\r\n\t}\r\n\tconst percentComplete: number = args[0],\r\n\t\tfakeAnimation = {\r\n\t\t\telements,\r\n\t\t\telement: elements[0],\r\n\t\t\tqueue: false,\r\n\t\t\toptions: {\r\n\t\t\t\tduration: 1000,\r\n\t\t\t},\r\n\t\t\ttweens: null as {[property: string]: Sequence},\r\n\t\t} as any as AnimationCall,\r\n\t\tresult: {[property: string]: string} = {};\r\n\tlet properties: Properties = args[1],\r\n\t\tsingleResult: boolean,\r\n\t\tmaybeSequence: SequenceList,\r\n\t\teasing: VelocityEasingType = args[2],\r\n\t\tcount = 0;\r\n\r\n\tif (isString(args[1])) {\r\n\t\tif (SequencesObject && SequencesObject[args[1]]) {\r\n\t\t\tmaybeSequence = SequencesObject[args[1]];\r\n\t\t\tproperties = {};\r\n\t\t\teasing = args[2];\r\n\t\t} else {\r\n\t\t\tsingleResult = true;\r\n\t\t\tproperties = {\r\n\t\t\t\t[args[1]]: args[2],\r\n\t\t\t};\r\n\t\t\teasing = args[3];\r\n\t\t}\r\n\t} else if (Array.isArray(args[1])) {\r\n\t\tsingleResult = true;\r\n\t\tproperties = {\r\n\t\t\ttween: args[1],\r\n\t\t} as any;\r\n\t\teasing = args[2];\r\n\t}\r\n\tif (!isNumber(percentComplete) || percentComplete < 0 || percentComplete > 1) {\r\n\t\tthrow new Error(\"VelocityJS: Must tween a percentage from 0 to 1!\");\r\n\t}\r\n\tif (!isPlainObject(properties)) {\r\n\t\tthrow new Error(\"VelocityJS: Cannot tween an invalid property!\");\r\n\t}\r\n\tif (requireForcefeeding) {\r\n\t\tfor (const property in properties) {\r\n\t\t\tif (properties.hasOwnProperty(property) && (!Array.isArray(properties[property]) || properties[property].length < 2)) {\r\n\t\t\t\tthrow new Error(\"VelocityJS: When not supplying an element you must force-feed values: \" + property);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst activeEasing = validateEasing(getValue(easing, defaults.easing), DEFAULT_DURATION);\r\n\r\n\tif (maybeSequence) {\r\n\t\texpandSequence(fakeAnimation, maybeSequence);\r\n\t} else {\r\n\t\texpandProperties(fakeAnimation as AnimationCall, properties);\r\n\t}\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const property in fakeAnimation.tweens) {\r\n\t\t// For every element, iterate through each property.\r\n\t\tconst propertyTween = fakeAnimation.tweens[property],\r\n\t\t\tsequence = propertyTween.sequence,\r\n\t\t\tpattern = sequence.pattern;\r\n\t\tlet currentValue = \"\",\r\n\t\t\ti = 0;\r\n\r\n\t\tcount++;\r\n\t\tif (pattern) {\r\n\t\t\tconst easingComplete = (propertyTween.easing || activeEasing)(percentComplete, 0, 1, property);\r\n\t\t\tlet best = 0;\r\n\r\n\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\r\n\t\t\t\tif (sequence[j].percent < easingComplete) {\r\n\t\t\t\t\tbest = j;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst tweenFrom: TweenStep = sequence[best],\r\n\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\r\n\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\r\n\t\t\t\ttweenEasing = tweenTo.easing || linearEasing;\r\n\r\n\t\t\tfor (; i < pattern.length; i++) {\r\n\t\t\t\tconst startValue = tweenFrom[i];\r\n\r\n\t\t\t\tif (startValue == null) {\r\n\t\t\t\t\tcurrentValue += pattern[i];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst endValue = tweenTo[i];\r\n\r\n\t\t\t\t\tif (startValue === endValue) {\r\n\t\t\t\t\t\tcurrentValue += startValue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\r\n\t\t\t\t\t\tconst value = tweenEasing(tweenPercent, startValue as number, endValue as number, property);\r\n\r\n\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(value) : value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresult[property] = currentValue;\r\n\t\t}\r\n\t}\r\n\r\n\tif (singleResult && count === 1) {\r\n\t\tfor (const property in result) {\r\n\t\t\tif (result.hasOwnProperty(property)) {\r\n\t\t\t\treturn result[property];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nregisterAction([\"tween\", tweenAction], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {ColorNames} from \"./fixColors\";\r\n\r\n/**\r\n * Converting from hex as it makes for a smaller file.\r\n */\r\nconst colorValues = {\r\n\taliceblue: 0xF0F8FF,\r\n\tantiquewhite: 0xFAEBD7,\r\n\taqua: 0x00FFFF,\r\n\taquamarine: 0x7FFFD4,\r\n\tazure: 0xF0FFFF,\r\n\tbeige: 0xF5F5DC,\r\n\tbisque: 0xFFE4C4,\r\n\tblack: 0x000000,\r\n\tblanchedalmond: 0xFFEBCD,\r\n\tblue: 0x0000FF,\r\n\tblueviolet: 0x8A2BE2,\r\n\tbrown: 0xA52A2A,\r\n\tburlywood: 0xDEB887,\r\n\tcadetblue: 0x5F9EA0,\r\n\tchartreuse: 0x7FFF00,\r\n\tchocolate: 0xD2691E,\r\n\tcoral: 0xFF7F50,\r\n\tcornflowerblue: 0x6495ED,\r\n\tcornsilk: 0xFFF8DC,\r\n\tcrimson: 0xDC143C,\r\n\tcyan: 0x00FFFF,\r\n\tdarkblue: 0x00008B,\r\n\tdarkcyan: 0x008B8B,\r\n\tdarkgoldenrod: 0xB8860B,\r\n\tdarkgray: 0xA9A9A9,\r\n\tdarkgrey: 0xA9A9A9,\r\n\tdarkgreen: 0x006400,\r\n\tdarkkhaki: 0xBDB76B,\r\n\tdarkmagenta: 0x8B008B,\r\n\tdarkolivegreen: 0x556B2F,\r\n\tdarkorange: 0xFF8C00,\r\n\tdarkorchid: 0x9932CC,\r\n\tdarkred: 0x8B0000,\r\n\tdarksalmon: 0xE9967A,\r\n\tdarkseagreen: 0x8FBC8F,\r\n\tdarkslateblue: 0x483D8B,\r\n\tdarkslategray: 0x2F4F4F,\r\n\tdarkslategrey: 0x2F4F4F,\r\n\tdarkturquoise: 0x00CED1,\r\n\tdarkviolet: 0x9400D3,\r\n\tdeeppink: 0xFF1493,\r\n\tdeepskyblue: 0x00BFFF,\r\n\tdimgray: 0x696969,\r\n\tdimgrey: 0x696969,\r\n\tdodgerblue: 0x1E90FF,\r\n\tfirebrick: 0xB22222,\r\n\tfloralwhite: 0xFFFAF0,\r\n\tforestgreen: 0x228B22,\r\n\tfuchsia: 0xFF00FF,\r\n\tgainsboro: 0xDCDCDC,\r\n\tghostwhite: 0xF8F8FF,\r\n\tgold: 0xFFD700,\r\n\tgoldenrod: 0xDAA520,\r\n\tgray: 0x808080,\r\n\tgrey: 0x808080,\r\n\tgreen: 0x008000,\r\n\tgreenyellow: 0xADFF2F,\r\n\thoneydew: 0xF0FFF0,\r\n\thotpink: 0xFF69B4,\r\n\tindianred: 0xCD5C5C,\r\n\tindigo: 0x4B0082,\r\n\tivory: 0xFFFFF0,\r\n\tkhaki: 0xF0E68C,\r\n\tlavender: 0xE6E6FA,\r\n\tlavenderblush: 0xFFF0F5,\r\n\tlawngreen: 0x7CFC00,\r\n\tlemonchiffon: 0xFFFACD,\r\n\tlightblue: 0xADD8E6,\r\n\tlightcoral: 0xF08080,\r\n\tlightcyan: 0xE0FFFF,\r\n\tlightgoldenrodyellow: 0xFAFAD2,\r\n\tlightgray: 0xD3D3D3,\r\n\tlightgrey: 0xD3D3D3,\r\n\tlightgreen: 0x90EE90,\r\n\tlightpink: 0xFFB6C1,\r\n\tlightsalmon: 0xFFA07A,\r\n\tlightseagreen: 0x20B2AA,\r\n\tlightskyblue: 0x87CEFA,\r\n\tlightslategray: 0x778899,\r\n\tlightslategrey: 0x778899,\r\n\tlightsteelblue: 0xB0C4DE,\r\n\tlightyellow: 0xFFFFE0,\r\n\tlime: 0x00FF00,\r\n\tlimegreen: 0x32CD32,\r\n\tlinen: 0xFAF0E6,\r\n\tmagenta: 0xFF00FF,\r\n\tmaroon: 0x800000,\r\n\tmediumaquamarine: 0x66CDAA,\r\n\tmediumblue: 0x0000CD,\r\n\tmediumorchid: 0xBA55D3,\r\n\tmediumpurple: 0x9370DB,\r\n\tmediumseagreen: 0x3CB371,\r\n\tmediumslateblue: 0x7B68EE,\r\n\tmediumspringgreen: 0x00FA9A,\r\n\tmediumturquoise: 0x48D1CC,\r\n\tmediumvioletred: 0xC71585,\r\n\tmidnightblue: 0x191970,\r\n\tmintcream: 0xF5FFFA,\r\n\tmistyrose: 0xFFE4E1,\r\n\tmoccasin: 0xFFE4B5,\r\n\tnavajowhite: 0xFFDEAD,\r\n\tnavy: 0x000080,\r\n\toldlace: 0xFDF5E6,\r\n\tolive: 0x808000,\r\n\tolivedrab: 0x6B8E23,\r\n\torange: 0xFFA500,\r\n\torangered: 0xFF4500,\r\n\torchid: 0xDA70D6,\r\n\tpalegoldenrod: 0xEEE8AA,\r\n\tpalegreen: 0x98FB98,\r\n\tpaleturquoise: 0xAFEEEE,\r\n\tpalevioletred: 0xDB7093,\r\n\tpapayawhip: 0xFFEFD5,\r\n\tpeachpuff: 0xFFDAB9,\r\n\tperu: 0xCD853F,\r\n\tpink: 0xFFC0CB,\r\n\tplum: 0xDDA0DD,\r\n\tpowderblue: 0xB0E0E6,\r\n\tpurple: 0x800080,\r\n\trebeccapurple: 0x663399,\r\n\tred: 0xFF0000,\r\n\trosybrown: 0xBC8F8F,\r\n\troyalblue: 0x4169E1,\r\n\tsaddlebrown: 0x8B4513,\r\n\tsalmon: 0xFA8072,\r\n\tsandybrown: 0xF4A460,\r\n\tseagreen: 0x2E8B57,\r\n\tseashell: 0xFFF5EE,\r\n\tsienna: 0xA0522D,\r\n\tsilver: 0xC0C0C0,\r\n\tskyblue: 0x87CEEB,\r\n\tslateblue: 0x6A5ACD,\r\n\tslategray: 0x708090,\r\n\tslategrey: 0x708090,\r\n\tsnow: 0xFFFAFA,\r\n\tspringgreen: 0x00FF7F,\r\n\tsteelblue: 0x4682B4,\r\n\ttan: 0xD2B48C,\r\n\tteal: 0x008080,\r\n\tthistle: 0xD8BFD8,\r\n\ttomato: 0xFF6347,\r\n\tturquoise: 0x40E0D0,\r\n\tviolet: 0xEE82EE,\r\n\twheat: 0xF5DEB3,\r\n\twhite: 0xFFFFFF,\r\n\twhitesmoke: 0xF5F5F5,\r\n\tyellow: 0xFFFF00,\r\n\tyellowgreen: 0x9ACD32,\r\n};\r\n\r\nfor (const name in colorValues) {\r\n\tif (colorValues.hasOwnProperty(name)) {\r\n\t\tconst color = colorValues[name];\r\n\r\n\t\tColorNames[name] = `${Math.floor(color / 65536)},${Math.floor(color / 256 % 256)},${(color % 256)}`;\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Back easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nexport function registerBackIn(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackOut(name: string, amount: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (Math.pow(--percentComplete, 2) * ((amount + 1) * percentComplete + amount) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerBackInOut(name: string, amount: number) {\r\n\tamount *= 1.525;\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tpercentComplete *= 2;\r\n\r\n\t\treturn (percentComplete < 1\r\n\t\t\t? (Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount))\r\n\t\t\t: (Math.pow(percentComplete - 2, 2) * ((amount + 1) * (percentComplete - 2) + amount) + 2)\r\n\t\t) * 0.5 * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterBackIn(\"easeInBack\", 1.7);\r\nregisterBackOut(\"easeOutBack\", 1.7);\r\nregisterBackInOut(\"easeInOutBack\", 1.7);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Bounce easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\nfunction easeOutBouncePercent(percentComplete: number): number {\r\n\tif (percentComplete < 1 / 2.75) {\r\n\t\treturn (7.5625 * percentComplete * percentComplete);\r\n\t}\r\n\tif (percentComplete < 2 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 1.5 / 2.75) * percentComplete + 0.75);\r\n\t}\r\n\tif (percentComplete < 2.5 / 2.75) {\r\n\t\treturn (7.5625 * (percentComplete -= 2.25 / 2.75) * percentComplete + 0.9375);\r\n\t}\r\n\r\n\treturn (7.5625 * (percentComplete -= 2.625 / 2.75) * percentComplete + 0.984375);\r\n}\r\n\r\nfunction easeInBouncePercent(percentComplete: number): number {\r\n\treturn 1 - easeOutBouncePercent(1 - percentComplete);\r\n}\r\n\r\nexport function easeInBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeInBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn easeOutBouncePercent(percentComplete) * (endValue - startValue);\r\n}\r\n\r\nexport function easeInOutBounce(percentComplete: number, startValue: number, endValue: number): number {\r\n\tif (percentComplete === 0) {\r\n\t\treturn startValue;\r\n\t}\r\n\tif (percentComplete === 1) {\r\n\t\treturn endValue;\r\n\t}\r\n\r\n\treturn (percentComplete < 0.5\r\n\t\t? easeInBouncePercent(percentComplete * 2) * 0.5\r\n\t\t: easeOutBouncePercent(percentComplete * 2 - 1) * 0.5 + 0.5\r\n\t) * (endValue - startValue);\r\n}\r\n\r\nregisterEasing([\"easeInBounce\", easeInBounce]);\r\nregisterEasing([\"easeOutBounce\", easeOutBounce]);\r\nregisterEasing([\"easeInOutBounce\", easeInOutBounce]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Elastic easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n// Constants\r\nconst PI2 = Math.PI * 2;\r\n\r\nexport function registerElasticIn(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn -(amplitude * Math.pow(2, 10 * (percentComplete -= 1)) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period)) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\r\n\t\treturn (amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period) + 1) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nexport function registerElasticInOut(name: string, amplitude: number, period: number) {\r\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\r\n\t\tif (percentComplete === 0) {\r\n\t\t\treturn startValue;\r\n\t\t}\r\n\t\tif (percentComplete === 1) {\r\n\t\t\treturn endValue;\r\n\t\t}\r\n\t\tconst s = period / PI2 * Math.asin(1 / amplitude);\r\n\r\n\t\tpercentComplete = percentComplete * 2 - 1;\r\n\r\n\t\treturn (percentComplete < 0\r\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period))\r\n\t\t\t: amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period) * 0.5 + 1\r\n\t\t) * (endValue - startValue);\r\n\t}]);\r\n}\r\n\r\nregisterElasticIn(\"easeInElastic\", 1, 0.3);\r\nregisterElasticOut(\"easeOutElastic\", 1, 0.3);\r\nregisterElasticInOut(\"easeInOutElastic\", 1, 0.3 * 1.5);\r\n\r\n// TODO: Expose these as actions to register custom easings?\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Easings to act on strings, either set at the start or at the end depending on\r\n * need.\r\n */\r\n\r\n// Project\r\nimport {registerEasing} from \"./easings\";\r\n\r\n/**\r\n * Easing function that sets to the specified value immediately after the\r\n * animation starts.\r\n */\r\nexport function atStart(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value while the animation is\r\n * running.\r\n */\r\nexport function during(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 0 || percentComplete === 1\r\n\t\t? startValue\r\n\t\t: endValue;\r\n}\r\n\r\n/**\r\n * Easing function that sets to the specified value when the animation ends.\r\n */\r\nexport function atEnd(percentComplete: number, startValue: any, endValue: any): any {\r\n\treturn percentComplete === 1\r\n\t\t? endValue\r\n\t\t: startValue;\r\n}\r\n\r\nregisterEasing([\"at-start\", atStart]);\r\nregisterEasing([\"during\", during]);\r\nregisterEasing([\"at-end\", atEnd]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {augmentDimension} from \"../css/augmentDimension\";\r\nimport {setPropertyValue} from \"../css/setPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get/set the inner/outer dimension.\r\n */\r\nfunction getDimension(name: \"width\" | \"height\", wantInner: boolean) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn augmentDimension(element, name, wantInner) + \"px\";\r\n\t\t}\r\n\t\tsetPropertyValue(element, name, (parseFloat(propertyValue) - augmentDimension(element, name, wantInner)) + \"px\");\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"innerWidth\", getDimension(\"width\", true)]);\r\nregisterNormalization([\"Element\", \"innerHeight\", getDimension(\"height\", true)]);\r\nregisterNormalization([\"Element\", \"outerWidth\", getDimension(\"width\", false)]);\r\nregisterNormalization([\"Element\", \"outerHeight\", getDimension(\"height\", false)]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {Data} from \"../data\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n// Constants\r\nexport const inlineRx = /^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|let|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i,\r\n\tlistItemRx = /^(li)$/i,\r\n\ttableRowRx = /^(tr)$/i,\r\n\ttableRx = /^(table)$/i,\r\n\ttableRowGroupRx = /^(tbody)$/i;\r\n\r\n/**\r\n * Display has an extra value of \"auto\" that works out the correct value\r\n * based on the type of element.\r\n */\r\nfunction display(element: HTMLorSVGElement): string;\r\nfunction display(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction display(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tconst style = element.style;\r\n\r\n\tif (propertyValue === undefined) {\r\n\t\treturn computePropertyValue(element, \"display\");\r\n\t}\r\n\tif (propertyValue === \"auto\") {\r\n\t\tconst nodeName = element && element.nodeName,\r\n\t\t\tdata = Data(element);\r\n\r\n\t\tif (inlineRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"inline\";\r\n\t\t} else if (listItemRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"list-item\";\r\n\t\t} else if (tableRowRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row\";\r\n\t\t} else if (tableRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table\";\r\n\t\t} else if (tableRowGroupRx.test(nodeName)) {\r\n\t\t\tpropertyValue = \"table-row-group\";\r\n\t\t} else {\r\n\t\t\t// Default to \"block\" when no match is found.\r\n\t\t\tpropertyValue = \"block\";\r\n\t\t}\r\n\t\t// IMPORTANT: We need to do this as getPropertyValue bypasses the\r\n\t\t// Normalisation when it exists in the cache.\r\n\t\tdata.cache[\"display\"] = propertyValue;\r\n\t}\r\n\tstyle.display = propertyValue;\r\n}\r\n\r\nregisterNormalization([\"Element\", \"display\", display]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {getPropertyValue} from \"../css/getPropertyValue\";\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction clientWidth(element: HTMLorSVGElement): string;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollWidth of an element.\r\n */\r\nfunction scrollWidth(element: HTMLorSVGElement): string;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollWidth + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction clientHeight(element: HTMLorSVGElement): string;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction clientHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.clientHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Get the scrollHeight of an element.\r\n */\r\nfunction scrollHeight(element: HTMLorSVGElement): string;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue: string): void;\r\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\r\n\tif (propertyValue == null) {\r\n\t\treturn element.scrollHeight + \"px\";\r\n\t}\r\n}\r\n\r\n/**\r\n * Scroll an element.\r\n */\r\nfunction scroll(direction: \"Height\", end: \"Top\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Width\", end: \"Left\"): VelocityNormalizationsFn;\r\nfunction scroll(direction: \"Height\" | \"Width\", end: \"Top\" | \"Left\"): VelocityNormalizationsFn {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue == null) {\r\n\t\t\t// Make sure we have these values cached.\r\n\t\t\tgetPropertyValue(element, \"client\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + direction, null, true);\r\n\t\t\tgetPropertyValue(element, \"scroll\" + end, null, true);\r\n\r\n\t\t\treturn element[\"scroll\" + end] + \"px\";\r\n\t\t}\r\n\t\tconst value = parseFloat(propertyValue),\r\n\t\t\tunit = propertyValue.replace(String(value), \"\");\r\n\r\n\t\tswitch (unit) {\r\n\t\t\tcase \"\":\r\n\t\t\tcase \"px\":\r\n\t\t\t\telement[\"scroll\" + end] = value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"%\":\r\n\t\t\t\tconst client = parseFloat(getPropertyValue(element, \"client\" + direction)),\r\n\t\t\t\t\tscrollValue = parseFloat(getPropertyValue(element, \"scroll\" + direction));\r\n\r\n\t\t\t\telement[\"scroll\" + end] = Math.max(0, scrollValue - client) * value / 100;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"HTMLElement\", \"scroll\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollTop\", scroll(\"Height\", \"Top\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollLeft\", scroll(\"Width\", \"Left\"), false]);\r\nregisterNormalization([\"HTMLElement\", \"scrollWidth\", scrollWidth]);\r\nregisterNormalization([\"HTMLElement\", \"clientWidth\", clientWidth]);\r\nregisterNormalization([\"HTMLElement\", \"scrollHeight\", scrollHeight]);\r\nregisterNormalization([\"HTMLElement\", \"clientHeight\", clientHeight]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * This handles all CSS style properties. With browser prefixed properties it\r\n * will register a version that handles setting (and getting) both the prefixed\r\n * and non-prefixed version.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {ALL_VENDOR_PREFIXES} from \"../../constants\";\r\nimport {isString} from \"../../types\";\r\nimport {computePropertyValue} from \"../css/getPropertyValue\";\r\nimport {State} from \"../state\";\r\nimport {hasNormalization, registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * An RegExp pattern for the following list of css words using\r\n * http://kemio.com.ar/tools/lst-trie-re.php to generate:\r\n *\r\n * blockSize\r\n * borderBottomLeftRadius\r\n * borderBottomRightRadius\r\n * borderBottomWidth\r\n * borderImageOutset\r\n * borderImageWidth\r\n * borderLeftWidth\r\n * borderRadius\r\n * borderRightWidth\r\n * borderSpacing\r\n * borderTopLeftRadius\r\n * borderTopRightRadius\r\n * borderTopWidth\r\n * borderWidth\r\n * bottom\r\n * columnGap\r\n * columnRuleWidth\r\n * columnWidth\r\n * flexBasis\r\n * fontSize\r\n * gridColumnGap\r\n * gridGap\r\n * gridRowGap\r\n * height\r\n * inlineSize\r\n * left\r\n * letterSpacing\r\n * margin\r\n * marginBottom\r\n * marginLeft\r\n * marginRight\r\n * marginTop\r\n * maxBlockSize\r\n * maxHeight\r\n * maxInlineSize\r\n * maxWidth\r\n * minBlockSize\r\n * minHeight\r\n * minInlineSize\r\n * minWidth\r\n * objectPosition\r\n * outlineOffset\r\n * outlineWidth\r\n * padding\r\n * paddingBottom\r\n * paddingLeft\r\n * paddingRight\r\n * paddingTop\r\n * perspective\r\n * right\r\n * shapeMargin\r\n * strokeDashoffset\r\n * strokeWidth\r\n * textIndent\r\n * top\r\n * transformOrigin\r\n * width\r\n * wordSpacing\r\n */\r\n// tslint:disable-next-line:max-line-length\r\nconst rxAddPx = /^(b(lockSize|o(rder(Bottom(LeftRadius|RightRadius|Width)|Image(Outset|Width)|LeftWidth|R(adius|ightWidth)|Spacing|Top(LeftRadius|RightRadius|Width)|Width)|ttom))|column(Gap|RuleWidth|Width)|f(lexBasis|ontSize)|grid(ColumnGap|Gap|RowGap)|height|inlineSize|le(ft|tterSpacing)|m(a(rgin(Bottom|Left|Right|Top)|x(BlockSize|Height|InlineSize|Width))|in(BlockSize|Height|InlineSize|Width))|o(bjectPosition|utline(Offset|Width))|p(adding(Bottom|Left|Right|Top)|erspective)|right|s(hapeMargin|troke(Dashoffset|Width))|t(extIndent|op|ransformOrigin)|w(idth|ordSpacing))$/;\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a prefixed style\r\n * property.\r\n */\r\nfunction getSetPrefixed(propertyName: string, unprefixed: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName) || computePropertyValue(element, unprefixed);\r\n\t\t}\r\n\t\telement.style[propertyName] = element.style[unprefixed] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Return a Normalisation that can be used to set / get a style property.\r\n */\r\nfunction getSetStyle(propertyName: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn computePropertyValue(element, propertyName);\r\n\t\t}\r\n\t\telement.style[propertyName] = propertyValue;\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\n/**\r\n * Vendor prefixes. Chrome / Safari, Firefox, IE / Edge, Opera.\r\n */\r\nconst rxVendors = /^(webkit|moz|ms|o)[A-Z]/,\r\n\tprefixElement = State.prefixElement;\r\n\r\nfor (const propertyName in prefixElement.style) {\r\n\tif (rxVendors.test(propertyName)) {\r\n\t\tconst unprefixed = propertyName.replace(/^[a-z]+([A-Z])/, ($, letter: string) => letter.toLowerCase());\r\n\r\n\t\tif (ALL_VENDOR_PREFIXES || isString(prefixElement.style[unprefixed])) {\r\n\t\t\tconst addUnit = rxAddPx.test(unprefixed) ? \"px\" : undefined;\r\n\r\n\t\t\tregisterNormalization([\"Element\", unprefixed, getSetPrefixed(propertyName, unprefixed), addUnit]);\r\n\t\t}\r\n\t} else if (!hasNormalization([\"Element\", propertyName])) {\r\n\t\tconst addUnit = rxAddPx.test(propertyName) ? \"px\" : undefined;\r\n\r\n\t\tregisterNormalization([\"Element\", propertyName, getSetStyle(propertyName), addUnit]);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {isFunction, isString} from \"../../../types\";\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set an attribute.\r\n */\r\nfunction getAttribute(name: string) {\r\n\treturn ((element: Element, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\treturn element.getAttribute(name);\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nconst base = document.createElement(\"div\"),\r\n\trxSubtype = /^SVG(.*)Element$/,\r\n\trxElement = /Element$/;\r\n\r\nObject.getOwnPropertyNames(window)\r\n\t.forEach((property) => {\r\n\t\tconst subtype = rxSubtype.exec(property);\r\n\r\n\t\tif (subtype && subtype[1] !== \"SVG\") { // Don't do SVGSVGElement.\r\n\t\t\ttry {\r\n\t\t\t\tconst element = subtype[1] ? document.createElementNS(\"http://www.w3.org/2000/svg\", (subtype[1] || \"svg\").toLowerCase()) : document.createElement(\"svg\");\r\n\r\n\t\t\t\t// tslint:disable-next-line:forin\r\n\t\t\t\tfor (const attribute in element) {\r\n\t\t\t\t\t// Although this isn't a tween without prototypes, we do\r\n\t\t\t\t\t// want to get hold of all attributes and not just own ones.\r\n\t\t\t\t\tconst value = element[attribute];\r\n\r\n\t\t\t\t\tif (isString(attribute)\r\n\t\t\t\t\t\t&& !(attribute[0] === \"o\" && attribute[1] === \"n\")\r\n\t\t\t\t\t\t&& attribute !== attribute.toUpperCase()\r\n\t\t\t\t\t\t&& !rxElement.test(attribute)\r\n\t\t\t\t\t\t&& !(attribute in base)\r\n\t\t\t\t\t\t&& !isFunction(value)) {\r\n\t\t\t\t\t\t// TODO: Should this all be set on the generic SVGElement, it would save space and time, but not as powerful\r\n\t\t\t\t\t\tregisterNormalization([property, attribute, getAttribute(attribute)]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.error(`VelocityJS: Error when trying to identify SVG attributes on ${property}.`, e);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"../normalizations\";\r\n\r\n/**\r\n * Get/set the width or height.\r\n */\r\nfunction getDimension(name: string) {\r\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\r\n\t\tif (propertyValue === undefined) {\r\n\t\t\t// Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM.\r\n\t\t\ttry {\r\n\t\t\t\treturn (element as SVGGraphicsElement).getBBox()[name] + \"px\";\r\n\t\t\t} catch (e) {\r\n\t\t\t\treturn \"0px\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telement.setAttribute(name, propertyValue);\r\n\t}) as VelocityNormalizationsFn;\r\n}\r\n\r\nregisterNormalization([\"SVGElement\", \"width\", getDimension(\"width\")]);\r\nregisterNormalization([\"SVGElement\", \"height\", getDimension(\"height\")]);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\r\n\r\n// Project\r\nimport {registerNormalization} from \"./normalizations\";\r\n\r\n/**\r\n * A fake normalization used to allow the \"tween\" property easy access.\r\n */\r\nfunction getSetTween(element: HTMLorSVGElement, propertyValue?: string) {\r\n\tif (propertyValue === undefined) {\r\n\t\treturn \"\";\r\n\t}\r\n}\r\n\r\nregisterNormalization([\"Element\", \"tween\", getSetTween]);\r\n","/*\n * velocity-animate (C) 2014-2017 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Automatically generated\nexport const VERSION = \"2.0.3\";\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Typedefs\r\nimport {AnimationCall, SequenceList, VelocitySequence, VelocityTween} from \"../../velocity.d\";\r\n\r\n// Project\r\nimport {isNumber, isPlainObject, isString} from \"../types\";\r\nimport Velocity from \"../velocity\";\r\nimport {registerAction} from \"./actions/actions\";\r\nimport {camelCase} from \"./camelCase\";\r\nimport {getNormalization} from \"./normalizations/normalizations\";\r\nimport {validateDuration, validateEasing} from \"./options\";\r\nimport {SequencesObject} from \"./sequencesObject\";\r\nimport {findPattern} from \"./tweens\";\r\n\r\n// Constants\r\nimport {DEFAULT_DURATION} from \"../constants\";\r\n\r\nconst rxPercents = /(\\d*\\.\\d+|\\d+\\.?|from|to)/g;\r\n\r\nexport function expandSequence(animation: AnimationCall, sequence: SequenceList) {\r\n\tconst tweens = animation.tweens = Object.create(null),\r\n\t\telement = animation.element;\r\n\r\n\tfor (const propertyName in sequence.tweens) {\r\n\t\tif (sequence.tweens.hasOwnProperty(propertyName)) {\r\n\t\t\tconst fn = getNormalization(element, propertyName);\r\n\r\n\t\t\tif (!fn && propertyName !== \"tween\") {\r\n\t\t\t\tif (Velocity.debug) {\r\n\t\t\t\t\tconsole.log(`Skipping [${propertyName}] due to a lack of browser support.`);\r\n\t\t\t\t}\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttweens[propertyName] = {\r\n\t\t\t\tfn,\r\n\t\t\t\tsequence: sequence.tweens[propertyName],\r\n\t\t\t} as VelocityTween;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Used to register a sequence. This should never be called by users\r\n * directly, instead it should be called via an action:
\r\n * Velocity(\"registerSequence\", \"\"name\", VelocitySequence);\r\n */\r\nexport function registerSequence(args?: [string, VelocitySequence] | [{[name: string]: VelocitySequence}]) {\r\n\tif (isPlainObject(args[0])) {\r\n\t\tfor (const name in (args[0] as {[name: string]: VelocitySequence})) {\r\n\t\t\tif (args[0].hasOwnProperty(name)) {\r\n\t\t\t\tregisterSequence([name, args[0][name]]);\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (isString(args[0])) {\r\n\t\tconst name = args[0] as string,\r\n\t\t\tsequence = args[1] as VelocitySequence;\r\n\r\n\t\tif (!isString(name)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' name to an invalid value:`, name);\r\n\t\t} else if (!isPlainObject(sequence)) {\r\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' sequence to an invalid value:`, name, sequence);\r\n\t\t} else {\r\n\t\t\tif (SequencesObject[name]) {\r\n\t\t\t\tconsole.warn(`VelocityJS: Replacing named sequence:`, name);\r\n\t\t\t}\r\n\t\t\tconst percents: {[key: string]: string[]} = {},\r\n\t\t\t\tsteps: string[] = new Array(100),\r\n\t\t\t\tproperties: string[] = [],\r\n\t\t\t\tpercentages: string[] = [],\r\n\t\t\t\tsequenceList: SequenceList = SequencesObject[name] = {} as any,\r\n\t\t\t\tduration = validateDuration((sequence as any).duration);\r\n\r\n\t\t\tsequenceList.tweens = {};\r\n\t\t\tif (isNumber(duration)) {\r\n\t\t\t\tsequenceList.duration = duration;\r\n\t\t\t}\r\n\t\t\tfor (const part in sequence) {\r\n\t\t\t\tif (sequence.hasOwnProperty(part)) {\r\n\t\t\t\t\tconst keys = String(part)\r\n\t\t\t\t\t\t.match(rxPercents);\r\n\r\n\t\t\t\t\tif (keys) {\r\n\t\t\t\t\t\tpercentages.push(part);\r\n\t\t\t\t\t\tfor (const key of keys) {\r\n\t\t\t\t\t\t\tconst percent = key === \"from\"\r\n\t\t\t\t\t\t\t\t? 0\r\n\t\t\t\t\t\t\t\t: key === \"to\"\r\n\t\t\t\t\t\t\t\t\t? 100\r\n\t\t\t\t\t\t\t\t\t: parseFloat(key);\r\n\r\n\t\t\t\t\t\t\tif (percent < 0 || percent > 100) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid value as a percentage (0 <= n <= 100):`, name, percent);\r\n\t\t\t\t\t\t\t} else if (isNaN(percent)) {\r\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid number as a percentage:`, name, part, key);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (!percents[String(percent)]) {\r\n\t\t\t\t\t\t\t\t\tpercents[String(percent)] = [];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tpercents[String(percent)].push(part);\r\n\t\t\t\t\t\t\t\tfor (const property in sequence[part]) {\r\n\t\t\t\t\t\t\t\t\tif (!properties.includes(property)) {\r\n\t\t\t\t\t\t\t\t\t\tproperties.push(property);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst orderedPercents = Object.keys(percents)\r\n\t\t\t\t.sort((a, b) => {\r\n\t\t\t\t\tconst a1 = parseFloat(a),\r\n\t\t\t\t\t\tb1 = parseFloat(b);\r\n\r\n\t\t\t\t\treturn a1 > b1 ? 1 : a1 < b1 ? -1 : 0;\r\n\t\t\t\t});\r\n\r\n\t\t\torderedPercents.forEach((key) => {\r\n\t\t\t\tsteps.push.apply(percents[key]);\r\n\t\t\t});\r\n\t\t\tfor (const property of properties) {\r\n\t\t\t\tconst parts: string[] = [],\r\n\t\t\t\t\tpropertyName = camelCase(property);\r\n\r\n\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\tconst stepProperties = sequence[value];\r\n\r\n\t\t\t\t\t\tif (stepProperties[propertyName]) {\r\n\t\t\t\t\t\t\tparts.push(isString(stepProperties[propertyName])\r\n\t\t\t\t\t\t\t\t? stepProperties[propertyName]\r\n\t\t\t\t\t\t\t\t: stepProperties[propertyName][0]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (parts.length) {\r\n\t\t\t\t\tconst realSequence = findPattern(parts, propertyName);\r\n\t\t\t\t\tlet index = 0;\r\n\r\n\t\t\t\t\tif (realSequence) {\r\n\t\t\t\t\t\tfor (const key of orderedPercents) {\r\n\t\t\t\t\t\t\tfor (const value of percents[key]) {\r\n\t\t\t\t\t\t\t\tconst originalProperty = sequence[value][propertyName];\r\n\r\n\t\t\t\t\t\t\t\tif (originalProperty) {\r\n\t\t\t\t\t\t\t\t\tif (Array.isArray(originalProperty) && originalProperty.length > 1 && (isString(originalProperty[1]) || Array.isArray(originalProperty[1]))) {\r\n\t\t\t\t\t\t\t\t\t\trealSequence[index].easing = validateEasing(originalProperty[1], sequenceList.duration || DEFAULT_DURATION);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\trealSequence[index++].percent = parseFloat(key) / 100;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsequenceList.tweens[propertyName] = realSequence;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nregisterAction([\"registerSequence\", registerSequence], true);\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Core \"Velocity\" function.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, StrictVelocityOptions,\r\n\tVelocityElements, VelocityExtended, VelocityObjectArgs, VelocityOptions, VelocityPromise,\r\n\tVelocityProperty, VelocityResult,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {isBoolean, isFunction, isNode, isPlainObject, isString, isVelocityResult, isWrapped} from \"./types\";\r\nimport {cloneArray, defineProperty, getValue} from \"./utility\";\r\nimport {Data} from \"./Velocity/data\";\r\nimport {\r\n\tvalidateBegin, validateComplete, validateDelay, validateDuration, validateEasing,\r\n\tvalidateLoop, validateProgress, validateQueue, validateRepeat, validateSpeed, validateSync,\r\n} from \"./Velocity/options\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {queue} from \"./Velocity/queue\";\r\nimport {expandSequence} from \"./Velocity/sequences\";\r\nimport {tick} from \"./Velocity/tick\";\r\nimport {expandProperties} from \"./Velocity/tweens\";\r\n\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\n\r\n/* tslint:disable:max-line-length */\r\n/**\r\n * The main Velocity function. Acts as a gateway to everything else.\r\n */\r\nexport function Velocity(options: VelocityObjectArgs): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, options?: VelocityOptions): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, easing?: string | number[], complete?: () => void): VelocityResult;\r\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\r\n/* tslint:enable:max-line-length */\r\nexport function Velocity(this: VelocityElements | void, ...argsList: any[]): VelocityResult {\r\n\tconst\r\n\t\t/**\r\n\t\t * A shortcut to the default options.\r\n\t\t */\r\n\t\tdefaults = DefaultObject,\r\n\t\t/**\r\n\t\t * Shortcut to arguments for file size.\r\n\t\t */\r\n\t\targs = arguments,\r\n\t\t/**\r\n\t\t * Cache of the first argument - this is used often enough to be saved.\r\n\t\t */\r\n\t\targs0 = args[0] as VelocityObjectArgs,\r\n\t\t/**\r\n\t\t * To allow for expressive CoffeeScript code, Velocity supports an\r\n\t\t * alternative syntax in which \"elements\" (or \"e\"), \"properties\" (or\r\n\t\t * \"p\"), and \"options\" (or \"o\") objects are defined on a container\r\n\t\t * object that's passed in as Velocity's sole argument.\r\n\t\t *\r\n\t\t * Note: Some browsers automatically populate arguments with a\r\n\t\t * \"properties\" object. We detect it by checking for its default\r\n\t\t * \"names\" property.\r\n\t\t */\r\n\t\t// TODO: Confirm which browsers - if <=IE8 the we can drop completely\r\n\t\tsyntacticSugar = isPlainObject(args0) && (args0.p || ((isPlainObject(args0.properties) && !(args0.properties as any).names) || isString(args0.properties)));\r\n\tlet\r\n\t\t/**\r\n\t\t * When Velocity is called via the utility function (Velocity()),\r\n\t\t * elements are explicitly passed in as the first parameter. Thus,\r\n\t\t * argument positioning varies.\r\n\t\t */\r\n\t\targumentIndex: number = 0,\r\n\t\t/**\r\n\t\t * The list of elements, extended with Promise and Velocity.\r\n\t\t */\r\n\t\telements: VelocityResult,\r\n\t\t/**\r\n\t\t * The properties being animated. This can be a string, in which case it\r\n\t\t * is either a function for these elements, or it is a \"named\" animation\r\n\t\t * sequence to use instead. Named sequences start with either \"callout.\"\r\n\t\t * or \"transition.\". When used as a callout the values will be reset\r\n\t\t * after finishing. When used as a transtition then there is no special\r\n\t\t * handling after finishing.\r\n\t\t */\r\n\t\tpropertiesMap: string | Properties,\r\n\t\t/**\r\n\t\t * Options supplied, this will be mapped and validated into\r\n\t\t * options.\r\n\t\t */\r\n\t\toptionsMap: VelocityOptions,\r\n\t\t/**\r\n\t\t * If called via a chain then this contains the last calls\r\n\t\t * animations. If this does not have a value then any access to the\r\n\t\t * element's animations needs to be to the currently-running ones.\r\n\t\t */\r\n\t\tanimations: AnimationCall[],\r\n\t\t/**\r\n\t\t * The promise that is returned.\r\n\t\t */\r\n\t\tpromise: Promise,\r\n\t\t// Used when the animation is finished\r\n\t\tresolver: (value?: VelocityResult) => void,\r\n\t\t// Used when there was an issue with one or more of the Velocity arguments\r\n\t\trejecter: (reason: any) => void;\r\n\r\n\t//console.log(`Velocity`, _arguments)\r\n\t// First get the elements, and the animations connected to the last call if\r\n\t// this is chained.\r\n\t// TODO: Clean this up a bit\r\n\t// TODO: Throw error if the chain is called with elements as the first argument. isVelocityResult(this) && ( (isNode(arg0) || isWrapped(arg0)) && arg0 == this)\r\n\tif (isNode(this)) {\r\n\t\t// This is from a chain such as document.getElementById(\"\").velocity(...)\r\n\t\telements = [this as HTMLorSVGElement] as VelocityResult;\r\n\t} else if (isWrapped(this)) {\r\n\t\t// This might be a chain from something else, but if chained from a\r\n\t\t// previous Velocity() call then grab the animations it's related to.\r\n\t\telements = cloneArray(this as HTMLorSVGElement[]) as VelocityResult;\r\n\t\tif (isVelocityResult(this)) {\r\n\t\t\tanimations = (this as VelocityResult).velocity.animations;\r\n\t\t}\r\n\t} else if (syntacticSugar) {\r\n\t\telements = cloneArray(args0.elements || args0.e) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isNode(args0)) {\r\n\t\telements = cloneArray([args0]) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t} else if (isWrapped(args0)) {\r\n\t\telements = cloneArray(args0) as VelocityResult;\r\n\t\targumentIndex++;\r\n\t}\r\n\t// Allow elements to be chained.\r\n\tif (elements) {\r\n\t\tdefineProperty(elements, \"velocity\", Velocity.bind(elements));\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t// Next get the propertiesMap and options.\r\n\tif (syntacticSugar) {\r\n\t\tpropertiesMap = getValue(args0.properties, args0.p);\r\n\t} else {\r\n\t\t// TODO: Should be possible to call Velocity(\"pauseAll\") - currently not possible\r\n\t\tpropertiesMap = args[argumentIndex++] as string | Properties;\r\n\t}\r\n\t// Get any options map passed in as arguments first, expand any direct\r\n\t// options if possible.\r\n\tconst isReverse = propertiesMap === \"reverse\",\r\n\t\tisAction = !isReverse && isString(propertiesMap),\r\n\t\tmaybeSequence = isAction && SequencesObject[propertiesMap as string],\r\n\t\topts = syntacticSugar ? getValue(args0.options, args0.o) : args[argumentIndex];\r\n\r\n\tif (isPlainObject(opts)) {\r\n\t\toptionsMap = opts;\r\n\t}\r\n\t// Create the promise if supported and wanted.\r\n\tif (Promise && getValue(optionsMap && optionsMap.promise, defaults.promise)) {\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\trejecter = reject;\r\n\t\t\t// IMPORTANT:\r\n\t\t\t// If a resolver tries to run on a Promise then it will wait until\r\n\t\t\t// that Promise resolves - but in this case we're running on our own\r\n\t\t\t// Promise, so need to make sure it's not seen as one. Setting these\r\n\t\t\t// values to undefined for the duration of the resolve.\r\n\t\t\t// Due to being an async call, they should be back to \"normal\"\r\n\t\t\t// before the .then() function gets called.\r\n\t\t\tresolver = (result: VelocityResult) => {\r\n\t\t\t\tif (isVelocityResult(result) && result.then) {\r\n\t\t\t\t\tconst then = result.then;\r\n\r\n\t\t\t\t\tresult.then = undefined; // Preserving enumeration etc\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t\tresult.then = then;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t});\r\n\t\tif (elements) {\r\n\t\t\tdefineProperty(elements, \"promise\", promise);\r\n\t\t\tdefineProperty(elements, \"then\", promise.then.bind(promise));\r\n\t\t\tdefineProperty(elements, \"catch\", promise.catch.bind(promise));\r\n\t\t\tif ((promise as any).finally) {\r\n\t\t\t\t// Semi-standard\r\n\t\t\t\tdefineProperty(elements, \"finally\", (promise as any).finally.bind(promise));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconst promiseRejectEmpty: boolean = getValue(optionsMap && optionsMap.promiseRejectEmpty, defaults.promiseRejectEmpty);\r\n\r\n\tif (promise) {\r\n\t\tif (!elements && !isAction) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No elements supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t} else if (!propertiesMap) {\r\n\t\t\tif (promiseRejectEmpty) {\r\n\t\t\t\trejecter(\"Velocity: No properties supplied, if that is deliberate then pass `promiseRejectEmpty:false` as an option. Aborting.\");\r\n\t\t\t} else {\r\n\t\t\t\tresolver();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ((!elements && !isAction) || !propertiesMap) {\r\n\t\treturn promise as any;\r\n\t}\r\n\r\n\t// NOTE: Can't use isAction here due to type inference - there are callbacks\r\n\t// between so the type isn't considered safe.\r\n\tif (isAction) {\r\n\t\tconst actionArgs: any[] = [],\r\n\t\t\tpromiseHandler: VelocityPromise = promise && {\r\n\t\t\t\t_promise: promise,\r\n\t\t\t\t_resolver: resolver,\r\n\t\t\t\t_rejecter: rejecter,\r\n\t\t\t};\r\n\r\n\t\twhile (argumentIndex < args.length) {\r\n\t\t\tactionArgs.push(args[argumentIndex++]);\r\n\t\t}\r\n\r\n\t\t// Velocity's behavior is categorized into \"actions\". If a string is\r\n\t\t// passed in instead of a propertiesMap then that will call a function\r\n\t\t// to do something special to the animation linked.\r\n\t\t// There is one special case - \"reverse\" - which is handled differently,\r\n\t\t// by being stored on the animation and then expanded when the animation\r\n\t\t// starts.\r\n\t\tconst action = (propertiesMap as string).replace(/\\..*$/, \"\"),\r\n\t\t\tcallback = ActionsObject[action];\r\n\r\n\t\tif (callback) {\r\n\t\t\tconst result = callback(actionArgs, elements, promiseHandler, propertiesMap as string);\r\n\r\n\t\t\tif (result !== undefined) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\r\n\t\t\treturn elements || promise as any;\r\n\t\t} else if (!maybeSequence) {\r\n\t\t\tconsole.error(`VelocityJS: First argument (${propertiesMap}) was not a property map, a known action, or a registered redirect. Aborting.`);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tlet hasValidDuration: boolean;\r\n\r\n\tif (isPlainObject(propertiesMap) || isReverse || maybeSequence) {\r\n\t\t/**\r\n\t\t * The options for this set of animations.\r\n\t\t */\r\n\t\tconst options: StrictVelocityOptions = {};\r\n\t\tlet isSync = defaults.sync;\r\n\r\n\t\t// Private options first - set as non-enumerable, and starting with an\r\n\t\t// underscore so we can filter them out.\r\n\t\tif (promise) {\r\n\t\t\tdefineProperty(options, \"_promise\", promise);\r\n\t\t\tdefineProperty(options, \"_rejecter\", rejecter);\r\n\t\t\tdefineProperty(options, \"_resolver\", resolver);\r\n\t\t}\r\n\t\tdefineProperty(options, \"_ready\", 0);\r\n\t\tdefineProperty(options, \"_started\", 0);\r\n\t\tdefineProperty(options, \"_completed\", 0);\r\n\t\tdefineProperty(options, \"_total\", 0);\r\n\r\n\t\t// Now check the optionsMap\r\n\t\tif (isPlainObject(optionsMap)) {\r\n\t\t\tconst validDuration = validateDuration(optionsMap.duration);\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\toptions.duration = getValue(validDuration, defaults.duration);\r\n\t\t\toptions.delay = getValue(validateDelay(optionsMap.delay), defaults.delay);\r\n\t\t\t// Need the extra fallback here in case it supplies an invalid\r\n\t\t\t// easing that we need to overrride with the default.\r\n\t\t\toptions.easing = validateEasing(getValue(optionsMap.easing, defaults.easing), options.duration) || validateEasing(defaults.easing, options.duration);\r\n\t\t\toptions.loop = getValue(validateLoop(optionsMap.loop), defaults.loop);\r\n\t\t\toptions.repeat = options.repeatAgain = getValue(validateRepeat(optionsMap.repeat), defaults.repeat);\r\n\t\t\tif (optionsMap.speed != null) {\r\n\t\t\t\toptions.speed = getValue(validateSpeed(optionsMap.speed), 1);\r\n\t\t\t}\r\n\t\t\tif (isBoolean(optionsMap.promise)) {\r\n\t\t\t\toptions.promise = optionsMap.promise;\r\n\t\t\t}\r\n\t\t\toptions.queue = getValue(validateQueue(optionsMap.queue), defaults.queue);\r\n\t\t\tif (optionsMap.mobileHA && !StateObject.isGingerbread) {\r\n\t\t\t\t/* When set to true, and if this is a mobile device, mobileHA automatically enables hardware acceleration (via a null transform hack)\r\n\t\t\t\t on animating elements. HA is removed from the element at the completion of its animation. */\r\n\t\t\t\t/* Note: Android Gingerbread doesn't support HA. If a null transform hack (mobileHA) is in fact set, it will prevent other tranform subproperties from taking effect. */\r\n\t\t\t\t/* Note: You can read more about the use of mobileHA in Velocity's documentation: velocity-animate/#mobileHA. */\r\n\t\t\t\toptions.mobileHA = true;\r\n\t\t\t}\r\n\t\t\tif (!isReverse) {\r\n\t\t\t\tif (optionsMap.display != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).display = optionsMap.display as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.display\" used, this is now a property:`, optionsMap.display);\r\n\t\t\t\t}\r\n\t\t\t\tif (optionsMap.visibility != null) {\r\n\t\t\t\t\t(propertiesMap as Properties).visibility = optionsMap.visibility as string;\r\n\t\t\t\t\tconsole.error(`Deprecated \"options.visibility\" used, this is now a property:`, optionsMap.visibility);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// TODO: Allow functional options for different options per element\r\n\t\t\tconst optionsBegin = validateBegin(optionsMap.begin),\r\n\t\t\t\toptionsComplete = validateComplete(optionsMap.complete),\r\n\t\t\t\toptionsProgress = validateProgress(optionsMap.progress),\r\n\t\t\t\toptionsSync = validateSync(optionsMap.sync);\r\n\r\n\t\t\tif (optionsBegin != null) {\r\n\t\t\t\toptions.begin = optionsBegin;\r\n\t\t\t}\r\n\t\t\tif (optionsComplete != null) {\r\n\t\t\t\toptions.complete = optionsComplete;\r\n\t\t\t}\r\n\t\t\tif (optionsProgress != null) {\r\n\t\t\t\toptions.progress = optionsProgress;\r\n\t\t\t}\r\n\t\t\tif (optionsSync != null) {\r\n\t\t\t\tisSync = optionsSync;\r\n\t\t\t}\r\n\t\t} else if (!syntacticSugar) {\r\n\t\t\t// Expand any direct options if possible.\r\n\t\t\tconst validDuration = validateDuration(args[argumentIndex], true);\r\n\t\t\tlet offset = 0;\r\n\r\n\t\t\thasValidDuration = validDuration !== undefined;\r\n\t\t\tif (validDuration !== undefined) {\r\n\t\t\t\toffset++;\r\n\t\t\t\toptions.duration = validDuration;\r\n\t\t\t}\r\n\t\t\tif (!isFunction(args[argumentIndex + offset])) {\r\n\t\t\t\t// Despite coming before Complete, we can't pass a fn easing\r\n\t\t\t\tconst easing = validateEasing(args[argumentIndex + offset], getValue(options && validateDuration(options.duration), defaults.duration) as number, true);\r\n\r\n\t\t\t\tif (easing !== undefined) {\r\n\t\t\t\t\toffset++;\r\n\t\t\t\t\toptions.easing = easing;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconst complete = validateComplete(args[argumentIndex + offset], true);\r\n\r\n\t\t\tif (complete !== undefined) {\r\n\t\t\t\toptions.complete = complete;\r\n\t\t\t}\r\n\t\t\toptions.loop = defaults.loop;\r\n\t\t\toptions.repeat = options.repeatAgain = defaults.repeat;\r\n\t\t}\r\n\r\n\t\tif (isReverse && options.queue === false) {\r\n\t\t\tthrow new Error(\"VelocityJS: Cannot reverse a queue:false animation.\");\r\n\t\t}\r\n\r\n\t\tif (maybeSequence && !hasValidDuration && maybeSequence.duration) {\r\n\t\t\toptions.duration = maybeSequence.duration;\r\n\t\t}\r\n\r\n\t\t// When a set of elements is targeted by a Velocity call, the set is\r\n\t\t// broken up and each element has the current Velocity call individually\r\n\t\t// queued onto it. In this way, each element's existing queue is\r\n\t\t// respected; some elements may already be animating and accordingly\r\n\t\t// should not have this current Velocity call triggered immediately\r\n\t\t// unless the sync:true option is used.\r\n\r\n\t\tconst rootAnimation: AnimationCall = {\r\n\t\t\toptions,\r\n\t\t\telements,\r\n\t\t\t_prev: undefined,\r\n\t\t\t_next: undefined,\r\n\t\t\t_flags: isSync ? AnimationFlags.SYNC : 0,\r\n\t\t\tpercentComplete: 0,\r\n\t\t\tellapsedTime: 0,\r\n\t\t\ttimeStart: 0,\r\n\t\t};\r\n\r\n\t\tanimations = [];\r\n\t\tfor (const element of elements) {\r\n\t\t\tlet flags = 0;\r\n\r\n\t\t\tif (isNode(element)) { // TODO: This needs to check for valid animation targets, not just Elements\r\n\t\t\t\tif (isReverse) {\r\n\t\t\t\t\tconst lastAnimation = Data(element).lastAnimationList[options.queue as string];\r\n\r\n\t\t\t\t\tpropertiesMap = lastAnimation && lastAnimation.tweens;\r\n\t\t\t\t\tif (!propertiesMap) {\r\n\t\t\t\t\t\tconsole.error(`VelocityJS: Attempting to reverse an animation on an element with no previous animation:`, element);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tflags |= AnimationFlags.REVERSE & ~(lastAnimation._flags & AnimationFlags.REVERSE); // tslint:disable-line:no-bitwise\r\n\t\t\t\t}\r\n\t\t\t\tconst animation: AnimationCall = {\r\n\t\t\t\t\t...rootAnimation,\r\n\t\t\t\t\telement,\r\n\t\t\t\t\t_flags: rootAnimation._flags | flags, // tslint:disable-line:no-bitwise\r\n\t\t\t\t};\r\n\r\n\t\t\t\toptions._total++;\r\n\t\t\t\tanimations.push(animation);\r\n\t\t\t\tif (maybeSequence) {\r\n\t\t\t\t\texpandSequence(animation, maybeSequence);\r\n\t\t\t\t} else if (isReverse) {\r\n\t\t\t\t\t// In this case we're using the previous animation, so\r\n\t\t\t\t\t// it will be expanded correctly when that one runs.\r\n\t\t\t\t\tanimation.tweens = propertiesMap as any;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tanimation.tweens = Object.create(null);\r\n\t\t\t\t\texpandProperties(animation, propertiesMap);\r\n\t\t\t\t}\r\n\t\t\t\tqueue(element, animation, options.queue);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (StateObject.isTicking === false) {\r\n\t\t\t// If the animation tick isn't running, start it. (Velocity shuts it\r\n\t\t\t// off when there are no active calls to process.)\r\n\t\t\ttick(false);\r\n\t\t}\r\n\t\tif (animations) {\r\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\r\n\t\t}\r\n\t}\r\n\t/***************\r\n\t Chaining\r\n\t ***************/\r\n\r\n\t/* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */\r\n\treturn elements || promise as any;\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n */\r\n\r\n// Project\r\nimport {defineProperty} from \"../utility\";\r\nimport {Velocity} from \"../velocityFn\";\r\n\r\n/**\r\n * Used to patch any object to allow Velocity chaining. In order to chain an\r\n * object must either be treatable as an array - with a .length\r\n * property, and each member a Node, or a Node directly.\r\n *\r\n * By default Velocity will try to patch window,\r\n * jQuery, Zepto, and several classes that return\r\n * Nodes or lists of Nodes.\r\n */\r\nexport function patch(proto: any, global?: boolean) {\r\n\ttry {\r\n\t\tdefineProperty(proto, (global ? \"V\" : \"v\") + \"elocity\", Velocity);\r\n\t} catch (e) {\r\n\t\tconsole.warn(`VelocityJS: Error when trying to add prototype.`, e);\r\n\t}\r\n}\r\n","/*\r\n * velocity-animate (C) 2014-2018 Julian Shapiro.\r\n *\r\n * Licensed under the MIT license. See LICENSE file in the project root for details.\r\n *\r\n * Extended Velocity members.\r\n */\r\n\r\n// Typedefs\r\nimport {\r\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\r\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\r\n} from \"./../velocity.d\";\r\n\r\n// Project\r\nimport {defineProperty} from \"./utility\";\r\nimport {Actions as ActionsObject} from \"./Velocity/actions/actions\";\r\nimport {defaults as DefaultObject} from \"./Velocity/defaults\";\r\nimport {Easings as EasingsObject} from \"./Velocity/easing/easings\";\r\nimport {patch as patchFn} from \"./Velocity/patch\";\r\nimport {SequencesObject} from \"./Velocity/sequencesObject\";\r\nimport {State as StateObject} from \"./Velocity/state\";\r\nimport {Velocity as VelocityFn} from \"./velocityFn\";\r\n\r\n// Build the entire library, even optional bits.\r\nimport \"./Velocity/_all\";\r\n\r\n// Constants\r\nimport {VERSION} from \"../version\";\r\nconst Velocity: VelocityPublic = VelocityFn as any;\r\n\r\n/**\r\n * These parts of Velocity absolutely must be included, even if they're unused!\r\n */\r\nnamespace VelocityStatic {\r\n\t/**\r\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\r\n\t * but they still exist). Otherwise they can be replaced by users.\r\n\t *\r\n\t * All external method calls should be using actions rather than sub-calls\r\n\t * of Velocity itself.\r\n\t */\r\n\texport const Actions: {[name: string]: VelocityActionFn} = ActionsObject;\r\n\r\n\t/**\r\n\t * Our known easing functions.\r\n\t */\r\n\texport const Easings: {[name: string]: VelocityEasingFn} = EasingsObject;\r\n\r\n\t/**\r\n\t * The currently registered sequences.\r\n\t */\r\n\texport const Sequences: {[name: string]: SequenceList} = SequencesObject;\r\n\r\n\t/**\r\n\t * Current internal state of Velocity.\r\n\t */\r\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\r\n\r\n\t/**\r\n\t * Velocity option defaults, which can be overriden by the user.\r\n\t */\r\n\texport const defaults: StrictVelocityOptions & {reset?: () => void} = DefaultObject;\r\n\r\n\t/**\r\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\r\n\t * object must either be treatable as an array - with a .length\r\n\t * property, and each member a Node, or a Node directly.\r\n\t *\r\n\t * By default Velocity will try to patch window,\r\n\t * jQuery, Zepto, and several classes that return\r\n\t * Nodes or lists of Nodes.\r\n\t */\r\n\texport const patch = patchFn;\r\n\r\n\t/**\r\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\r\n\t */\r\n\texport let debug: boolean | 1 | 2 = false;\r\n\r\n\t/**\r\n\t * In mock mode, all animations are forced to complete immediately upon the\r\n\t * next rAF tick. If there are further animations queued then they will each\r\n\t * take one single frame in turn. Loops and repeats will be disabled while\r\n\t * mock = true.\r\n\t */\r\n\texport let mock: boolean = false;\r\n\r\n\t/**\r\n\t * Save our version number somewhere visible.\r\n\t */\r\n\texport const version = VERSION;\r\n\r\n\t/**\r\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\r\n\t */\r\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\r\n}\r\n\r\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\r\nconst IE = (() => {\r\n\tinterface IEDocument extends Document {\r\n\t\tdocumentMode: any; // IE\r\n\t}\r\n\r\n\tif ((document as IEDocument).documentMode) {\r\n\t\treturn (document as IEDocument).documentMode;\r\n\t} else {\r\n\t\tfor (let i = 7; i > 4; i--) {\r\n\t\t\tlet div = document.createElement(\"div\");\r\n\r\n\t\t\tdiv.innerHTML = ``;\r\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\r\n\t\t\t\tdiv = null;\r\n\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n})();\r\n\r\n/******************\r\n Unsupported\r\n ******************/\r\n\r\nif (IE <= 8) {\r\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\r\n}\r\n\r\n/******************\r\n Frameworks\r\n ******************/\r\n\r\nif (window) {\r\n\t/*\r\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\r\n\t * wrapped elements to be subjected to plugin calls. If either framework is\r\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\r\n\t * animate() method. Velocity also registers itself onto a global container\r\n\t * (window.jQuery || window.Zepto || window) so that certain features are\r\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\r\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\r\n\t * elements.\r\n\t */\r\n\tconst jQuery: {fn: any} = (window as any).jQuery,\r\n\t\tZepto: {fn: any} = (window as any).Zepto;\r\n\r\n\tpatchFn(window, true);\r\n\tpatchFn(Element && Element.prototype);\r\n\tpatchFn(NodeList && NodeList.prototype);\r\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\r\n\r\n\tpatchFn(jQuery, true);\r\n\tpatchFn(jQuery && jQuery.fn);\r\n\r\n\tpatchFn(Zepto, true);\r\n\tpatchFn(Zepto && Zepto.fn);\r\n}\r\n\r\n// Make sure that the values within Velocity are read-only and upatchable.\r\nfor (const property in VelocityStatic) {\r\n\tif (VelocityStatic.hasOwnProperty(property)) {\r\n\t\tswitch (typeof property) {\r\n\t\t\tcase \"number\":\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tdefineProperty(Velocity, property, {\r\n\t\t\t\t\tget() {\r\n\t\t\t\t\t\treturn VelocityStatic[property];\r\n\t\t\t\t\t},\r\n\t\t\t\t\tset(value) {\r\n\t\t\t\t\t\tVelocityStatic[property] = value;\r\n\t\t\t\t\t},\r\n\t\t\t\t}, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Velocity; // tslint:disable-line:no-default-export\r\n"],"names":["variable","Object","prototype","toString","call","nodeType","proto","getPrototypeOf","hasOwnProperty","constructor","isNumber","length","isFunction","velocity","window","isString","isNode","obj","property","propertyIsEnumerable","element","className","Element","classList","add","removeClass","arrayLike","Array","slice","name","value","readonly","defineProperty","configurable","writable","args","arguments","arg","undefined","now","Date","getTime","remove","replace","RegExp","Actions","internal","callback","console","warn","registerAction","DURATION_FAST","DURATION_NORMAL","DURATION_SLOW","FUZZY_MS_PER_SECOND","DEFAULT_CACHE","DEFAULT_DELAY","DEFAULT_DURATION","DEFAULT_EASING","DEFAULT_FPSLIMIT","DEFAULT_LOOP","DEFAULT_PROMISE","DEFAULT_PROMISE_REJECT_EMPTY","DEFAULT_QUEUE","DEFAULT_REPEAT","DEFAULT_SPEED","DEFAULT_SYNC","CLASSNAME","Duration","fast","normal","slow","Easings","registerEasing","percentComplete","startValue","endValue","Math","cos","PI","exp","linearEasing","swingEasing","springEasing","num","min","max","aA1","aA2","aT","A","B","C","mX1","mY1","mX2","mY2","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","i","isNaN","isFinite","fixRange","mSampleValues","Float32Array","aX","aGuessT","currentSlope","getSlope","currentX","calcBezier","aA","aB","currentT","abs","lastSample","intervalStart","currentSample","dist","guessForT","initialSlope","newtonRaphsonIterate","binarySubdivide","precomputed","calcSampleValues","str","f","precompute","getTForX","getControlPoints","x","y","easeIn","generateBezier","easeOut","easeInOut","state","tension","friction","v","initialState","dt","derivative","dx","dv","springAccelerationForState","a","b","springEvaluateStateWithDerivative","c","d","dxdt","dvdt","duration","initState","parseFloat","path","tolerance","DT","haveDuration","timeLapsed","lastState","generateSpringRK4","springIntegrateState","push","floor","cache","steps","fn","round","def","toLowerCase","parseDuration","isBoolean","noError","parsed","error","isArray","generateStep","apply","parseInt","defaults","mobileHA","begin","complete","delay","easing","fpsLimit","loop","minFrameTime","promise","promiseRejectEmpty","queue","repeat","speed","sync","defineProperties","reset","enumerable","validateEasing","get","set","validateCache","validateBegin","validateComplete","validateDelay","validateDuration","validateFpsLimit","validateLoop","validatePromise","validatePromiseRejectEmpty","validateQueue","validateRepeat","validateSpeed","validateSync","Normalizations","NormalizationUnits","NoCacheNormalizations","Set","constructors","constructorCache","Map","dataName","data","ownerDocument","defaultView","types","index","newData","count","computedStyle","queueList","lastAnimationList","lastFinishList","isClient","windowScrollAnchor","pageYOffset","State","isMobile","test","navigator","userAgent","isAndroid","isGingerbread","isChrome","chrome","isFirefox","prefixElement","document","createElement","scrollAnchor","documentElement","body","parentNode","scrollPropertyLeft","scrollPropertyTop","isTicking","first","last","firstNew","animation","prev","_prev","_next","Data","addClass","queueName","animate","skip","next","options","activeCall","elements","setTimeout","getValue","isLoop","isRepeat","isStopped","_flags","repeatAgain","timeStart","ellapsedTime","_completed","_total","callComplete","resolver","_resolver","dequeue","freeAnimationCall","indexOf","nextArg","has","unit","units","includes","propertyName","registerNormalization","hasNormalization","propertyValue","noCache","getNormalization","Velocity","debug","info","fixed","$","letter","toUpperCase","rxColor6","rxColor3","rxColorName","rxRGB","rxSpaces","ColorNames","ignore","r","g","makeRGBA","$0","$1","$2","wantInner","isBorderBox","getPropertyValue","sides","fields","augment","field","getBoundingClientRect","augmentDimension","getComputedStyle","computedValue","setPropertyValue","getWidthHeight","String","style","position","topLeft","skipCache","rxHex","commands","function","elementArrayIndex","tween","number","getNormalizationUnit","string","fixColors","properties","tweens","create","camelCase","valueData","log","arr1","arr2","end","start","explodeTween","rxToken","rxNumber","parts","partsLength","tokens","indexes","numbers","part","cloneArray","match","sequence","pattern","addString","text","returnStringType","isDisplay","isVisibility","more","bits","isUnitless","hasNumbers","token","digits","change","changeOrUnit","index2","splice","firstLetter","patternCalc","isComplex","isMaths","bit","substring","inRGB","starting","findPattern","startNumbers","percent","JSON","stringify","timeCurrent","tweenValue","progress","nextCall","firstProgress","_nextProgress","callProgress","lastTick","firstComplete","_nextComplete","completeCall","FRAME_TIME","performance","perf","nowOffset","timing","navigationStart","rAFProxy","rAFShim","requestAnimationFrame","ticking","worker","interval","onmessage","e","setInterval","postMessage","clearInterval","Worker","URL","createObjectURL","Blob","workerFn","tick","asyncCallbacks","hidden","addEventListener","timestamp","deltaTime","defaultSpeed","defaultEasing","defaultDuration","lastProgress","lastComplete","validateTweens","flags","_ready","_started","_first","callBegin","delta","activeEasing","millisecondsEllapsed","mock","reverse","currentValue","easingComplete","best","j","tweenFrom","tweenTo","tweenPercent","result","startsWith","defaultQueue","endValues","promiseHandler","finishAll","isVelocityResult","animations","checkAnimationShouldBeFinished","then","finish","animationFlags","isExpanded","isReady","isStarted","isPaused","isSync","isReverse","action","key","flag","isPercentComplete","option","checkAnimation","pauseResume","SyntaxError","checkAnimationShouldBeStopped","stop","isPlainObject","_rejecter","join","styleAction","requireForcefeeding","Error","fakeAnimation","singleResult","maybeSequence","SequencesObject","expandSequence","expandProperties","propertyTween","tweenEasing","tweenAction","colorValues","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color","amount","pow","registerBackIn","registerBackOut","registerBackInOut","easeOutBouncePercent","easeInBouncePercent","easeInBounce","easeOutBounce","easeInOutBounce","PI2","amplitude","period","sin","asin","s","registerElasticIn","registerElasticOut","registerElasticInOut","atStart","during","atEnd","getDimension","inlineRx","listItemRx","tableRowRx","tableRx","tableRowGroupRx","computePropertyValue","nodeName","display","clientWidth","scrollWidth","clientHeight","scrollHeight","direction","client","scrollValue","scroll","rxAddPx","unprefixed","rxVendors","addUnit","getSetPrefixed","getSetStyle","getAttribute","setAttribute","base","rxSubtype","rxElement","getOwnPropertyNames","forEach","subtype","exec","createElementNS","attribute","getBBox","getSetTween","VERSION","VelocityFn","VelocityStatic","ActionsObject","EasingsObject","StateObject","DefaultObject","patchFn","IE","documentMode","div","innerHTML","getElementsByTagName","jQuery","Zepto","NodeList","HTMLCollection","rxPercents","registerSequence","percents","percentages","sequenceList","keys","orderedPercents","sort","a1","b1","stepProperties","realSequence","originalProperty","argsList","args0","syntacticSugar","p","names","argumentIndex","propertiesMap","optionsMap","rejecter","isWrapped","bind","isAction","opts","o","Promise","resolve","reject","catch","finally","actionArgs","_promise","hasValidDuration","validDuration","visibility","optionsBegin","optionsComplete","optionsProgress","validateProgress","optionsSync","offset","rootAnimation","lastAnimation","global"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA;;;AAGA,qBAA0BA;EACzB,WAAOA,aAAa,IAAb,IAAqBA,aAAa,KAAzC;EACA;AAED,EAaA;;;AAGA,sBAA2BA;EAC1B,WAAOC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,QAA/B,MAA6C,mBAApD;EACA;EAED;;;AAGA,kBAAuBA;EACtB,WAAO,CAAC,EAAEA,YAAaA,SAAqBK,QAApC,CAAR;EACA;EAED;;;AAGA,oBAAyBL;EACxB,WAAO,OAAOA,QAAP,KAAoB,QAA3B;EACA;AAED,EAOA;;;AAGA,yBAA8BA;EAC7B,QAAI,CAACA,QAAD,IAAa,QAAOA,QAAP,yCAAOA,QAAP,OAAoB,QAAjC,IAA8CA,SAAqBK,QAAnE,IAA+EJ,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,QAA/B,MAA6C,iBAAhI,EAAmJ;EAClJ,eAAO,KAAP;EACA;EACD,QAAMM,QAAQL,OAAOM,cAAP,CAAsBP,QAAtB,CAAd;EAEA,WAAO,CAACM,KAAD,IAAWA,MAAME,cAAN,CAAqB,aAArB,KAAuCF,MAAMG,WAAN,KAAsBR,MAA/E;EACA;AAED,EAOA;;;AAGA,oBAAyBD;EACxB,WAAO,OAAOA,QAAP,KAAoB,QAA3B;EACA;EAED;;;AAGA,4BAAiCA;EAChC,WAAOA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