3 Star 0 Fork 0

Gitee 极速下载 / velocity

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/julianshapiro/velocity
克隆/下载
velocity.js.map 296.72 KB
一键复制 编辑 原始数据 按行查看 历史
Ryc O'Chet 提交于 2020-04-10 14:00 . 2.0.6
{"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/sequencesObject.ts","src/Velocity/complete.ts","src/Velocity/normalizations/normalizations.ts","src/Velocity/css/setPropertyValue.ts","src/Velocity/css/removeNestedCalc.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/property.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":["/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Runtime type checking methods.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityResult} from \"./../velocity.d\";\n\n/**\n * Check if a variable is a boolean.\n */\nexport function isBoolean(variable: any): variable is boolean {\n\treturn variable === true || variable === false;\n}\n\n/**\n * Check if a variable is an empty object.\n */\nexport function isEmptyObject(variable: {}): variable is {} {\n\tfor (const name in variable) {\n\t\tif (variable.hasOwnProperty(name)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Check if a variable is a function.\n */\nexport function isFunction(variable: any): variable is Function { // tslint:disable-line:ban-types\n\treturn Object.prototype.toString.call(variable) === \"[object Function]\";\n}\n\n/**\n * Check if a variable is an HTMLElement or SVGElement.\n */\nexport function isNode(variable: any): variable is HTMLorSVGElement {\n\treturn !!(variable && (variable as Element).nodeType);\n}\n\n/**\n * Check if a variable is a number.\n */\nexport function isNumber(variable: any): variable is number {\n\treturn typeof variable === \"number\";\n}\n\n/**\n * Faster way to parse a string/number as a number https://jsperf.com/number-vs-parseint-vs-plus/3\n */\nexport function isNumberWhenParsed(variable: any): variable is number {\n\treturn !isNaN(Number(variable));\n}\n\n/**\n * Check if a variable is a plain object (and not an instance).\n */\nexport function isPlainObject(variable: any): variable is {} {\n\tif (!variable || typeof variable !== \"object\" || (variable as Element).nodeType || Object.prototype.toString.call(variable) !== \"[object Object]\") {\n\t\treturn false;\n\t}\n\tconst proto = Object.getPrototypeOf(variable) as object;\n\n\treturn !proto || (proto.hasOwnProperty(\"constructor\") && proto.constructor === Object);\n}\n\n/**\n * Check if a variable is an SVGElement.\n */\nexport function isSVG(variable: any): variable is SVGElement {\n\treturn SVGElement && variable instanceof SVGElement;\n}\n\n/**\n * Check if a variable is a string.\n */\nexport function isString(variable: any): variable is string {\n\treturn typeof variable === \"string\";\n}\n\n/**\n * Check if a variable is the result of calling Velocity.\n */\nexport function isVelocityResult(variable: any): variable is VelocityResult {\n\treturn variable && isNumber((variable as VelocityResult).length) && isFunction((variable as VelocityResult).velocity);\n}\n\n/**\n * Check if a variable is an array-like wrapped jQuery, Zepto or similar, where\n * each indexed value is a Node.\n */\n\nexport function isWrapped(variable: any): variable is HTMLorSVGElement[] {\n\treturn variable\n\t\t&& variable !== window\n\t\t&& isNumber((variable as HTMLorSVGElement[]).length)\n\t\t&& !isString(variable)\n\t\t&& !isFunction(variable)\n\t\t&& !isNode(variable)\n\t\t&& ((variable as HTMLorSVGElement[]).length === 0 || isNode(variable[0]));\n}\n\n/**\n * Check is a property is an enumerable member of an object.\n */\nexport function propertyIsEnumerable(obj: object, property: string): boolean {\n\treturn Object.prototype.propertyIsEnumerable.call(obj, property);\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement} from \"./../velocity.d\";\n\n// Project\nimport {isNode} from \"./types\";\n\n/**\n * Add a single className to an Element.\n */\nexport function addClass(element: HTMLorSVGElement, className: string): void {\n\tif (element instanceof Element) {\n\t\tif (element.classList) {\n\t\t\telement.classList.add(className);\n\t\t} else {\n\t\t\tremoveClass(element, className);\n\t\t\t(element as any).className += (element.className.length ? \" \" : \"\") + className;\n\t\t}\n\t}\n}\n\n/**\n * Clone an array, works for array-like too.\n */\nexport function cloneArray<T = any>(arrayLike: T[] | ArrayLike<T>): T[] {\n\treturn Array.prototype.slice.call(arrayLike, 0);\n}\n\n/**\n * The <strong><code>defineProperty()</code></strong> function provides a\n * shortcut to defining a property that cannot be accidentally iterated across.\n */\nexport function defineProperty(proto: any, name: string, value: any, readonly?: boolean) {\n\tif (proto) {\n\t\tObject.defineProperty(proto, name, {\n\t\t\tconfigurable: !readonly,\n\t\t\twritable: !readonly,\n\t\t\tvalue,\n\t\t});\n\t}\n}\n\n/**\n * When there are multiple locations for a value pass them all in, then get the\n * first value that is valid.\n */\nexport function getValue<T>(...args: T[]): T {\n\tfor (const arg of args) {\n\t\tif (arg !== undefined && arg === arg) {\n\t\t\treturn arg;\n\t\t}\n\t}\n}\n\n/**\n * Shim to get the current milliseconds - on anything except old IE it'll use\n * Date.now() and save creating an object. If that doesn't exist then it'll\n * create one that gets GC.\n */\nexport const now = Date.now ? Date.now : () => {\n\treturn (new Date()).getTime();\n};\n\n/**\n * Remove a single className from an Element.\n */\nexport function removeClass(element: HTMLorSVGElement, className: string): void {\n\tif (element instanceof Element) {\n\t\tif (element.classList) {\n\t\t\telement.classList.remove(className);\n\t\t} else {\n\t\t\t// TODO: Need some jsperf tests on performance - can we get rid of the regex and maybe use split / array manipulation?\n\t\t\t(element as any).className = element.className.replace(new RegExp(`(^|\\\\s)${className}(\\\\s|$)`, \"gi\"), \" \");\n\t\t}\n\t}\n}\n\n/**\n * Convert an element or array-like element list into an array if needed.\n */\nexport function sanitizeElements(elements: HTMLorSVGElement | HTMLorSVGElement[]): HTMLorSVGElement[] {\n\treturn isNode(elements)\n\t\t? [elements] as HTMLorSVGElement[]\n\t\t: elements as HTMLorSVGElement[];\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Actions that can be performed by passing a string instead of a propertiesMap.\n */\n\n// Typedefs\nimport {VelocityActionFn} from \"../../../velocity.d\";\n\n// Project\nimport {isFunction, isString, propertyIsEnumerable} from \"../../types\";\nimport {defineProperty} from \"../../utility\";\n\n// Constants\nexport const Actions: {[name: string]: VelocityActionFn} = {};\n\n/**\n * Used to register an action. This should never be called by users\n * directly, instead it should be called via an action:<br/>\n * <code>Velocity(\"registerAction\", \"name\", VelocityActionFn);</code>\n */\nexport function registerAction(args?: [string, VelocityActionFn], internal?: boolean) {\n\tconst name: string = args[0],\n\t\tcallback = args[1];\n\n\tif (!isString(name)) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' name to an invalid value:`, name);\n\t} else if (!isFunction(callback)) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerAction' callback to an invalid value:`, name, callback);\n\t} else if (Actions[name] && !propertyIsEnumerable(Actions, name)) {\n\t\tconsole.warn(`VelocityJS: Trying to override internal 'registerAction' callback`, name);\n\t} else if (internal === true) {\n\t\tdefineProperty(Actions, name, callback);\n\t} else {\n\t\tActions[name] = callback;\n\t}\n}\n\nregisterAction([\"registerAction\", registerAction as any], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Constants and defaults. These values should never change without a MINOR\n * version bump.\n */\n\n/**\n * Without this it will only un-prefix properties that have a valid \"normal\"\n * version.\n */\nexport const ALL_VENDOR_PREFIXES = true;\n\nexport const DURATION_FAST = 200;\nexport const DURATION_NORMAL = 400;\nexport const DURATION_SLOW = 600;\n\nexport const FUZZY_MS_PER_SECOND = 980;\n\nexport const DEFAULT_CACHE = true;\nexport const DEFAULT_DELAY = 0;\nexport const DEFAULT_DURATION = DURATION_NORMAL;\nexport const DEFAULT_EASING = \"swing\";\nexport const DEFAULT_FPSLIMIT = 60;\nexport const DEFAULT_LOOP = 0;\nexport const DEFAULT_PROMISE = true;\nexport const DEFAULT_PROMISE_REJECT_EMPTY = true;\nexport const DEFAULT_QUEUE = \"\";\nexport const DEFAULT_REPEAT = 0;\nexport const DEFAULT_SPEED = 1;\nexport const DEFAULT_SYNC = true;\n\nexport const CLASSNAME = \"velocity-animating\";\n\nexport const Duration = {\n\tfast: DURATION_FAST,\n\tnormal: DURATION_NORMAL,\n\tslow: DURATION_SLOW,\n};\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {VelocityEasingFn} from \"../../../velocity.d\";\n\n// Project\nimport {isFunction, isString} from \"../../types\";\nimport {registerAction} from \"../actions/actions\";\n\n// Constants\nexport const Easings: {[name: string]: VelocityEasingFn} = {};\n\n/**\n * Used to register a easing. This should never be called by users\n * directly, instead it should be called via an action:<br/>\n * <code>Velocity(\"registerEasing\", \"name\", VelocityEasingFn);</code>\n */\nexport function registerEasing(args?: [string, VelocityEasingFn]) {\n\tconst name: string = args[0],\n\t\tcallback = args[1];\n\n\tif (!isString(name)) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' name to an invalid value:`, name);\n\t} else if (!isFunction(callback)) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerEasing' callback to an invalid value:`, name, callback);\n\t} else if (Easings[name]) {\n\t\tconsole.warn(`VelocityJS: Trying to override 'registerEasing' callback`, name);\n\t} else {\n\t\tEasings[name] = callback;\n\t}\n}\n\nregisterAction([\"registerEasing\", registerEasing], true);\n\n/**\n * Linear easing, used for sequence parts that don't have an actual easing\n * function.\n */\nexport function linearEasing(percentComplete, startValue, endValue, property) {\n\treturn startValue + percentComplete * (endValue - startValue);\n}\n\n/**\n * Swing is the default for jQuery and Velocity.\n */\nexport function swingEasing(percentComplete, startValue, endValue) {\n\treturn startValue + (0.5 - Math.cos(percentComplete * Math.PI) / 2) * (endValue - startValue);\n}\n\n/**\n * A less exaggerated version of easeInOutElastic.\n */\nexport function springEasing(percentComplete, startValue, endValue) {\n\treturn startValue + (1 - (Math.cos(percentComplete * 4.5 * Math.PI) * Math.exp(-percentComplete * 6))) * (endValue - startValue);\n}\n\nregisterEasing([\"linear\", linearEasing]);\nregisterEasing([\"swing\", swingEasing]);\nregisterEasing([\"spring\", springEasing]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License\n */\n\n// Typedefs\nimport { VelocityEasingFn } from \"../../../velocity.d\";\n\n// Project\nimport { registerEasing } from \"./easings\";\n\n/**\n * Fix to a range of <code>0 <= num <= 1</code>.\n */\nfunction fixRange(num: number) {\n\treturn Math.min(Math.max(num, 0), 1);\n}\n\nfunction A(aA1, aA2) {\n\treturn 1 - 3 * aA2 + 3 * aA1;\n}\n\nfunction B(aA1, aA2) {\n\treturn 3 * aA2 - 6 * aA1;\n}\n\nfunction C(aA1) {\n\treturn 3 * aA1;\n}\n\nfunction calcBezier(aT, aA1, aA2) {\n\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\nfunction getSlope(aT, aA1, aA2) {\n\treturn 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);\n}\n\nexport function generateBezier(...args: [number, number, number, number]): VelocityEasingFn {\n\tconst NEWTON_ITERATIONS = 4,\n\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\tkSplineTableSize = 11,\n\t\tkSampleStepSize = 1 / (kSplineTableSize - 1),\n\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\n\t/* Must contain four args. */\n\tif (args.length !== 4) {\n\t\treturn;\n\t}\n\n\t/* Args must be numbers. */\n\tfor (let i = 0; i < 4; ++i) {\n\t\tif (typeof args[i] !== \"number\" || isNaN(args[i]) || !isFinite(args[i])) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* X values must be in the [0, 1] range. */\n\tconst mX1 = fixRange(args[0]);\n\tconst mY1 = args[1];\n\tconst mX2 = fixRange(args[2]);\n\tconst mY2 = args[3];\n\n\tconst mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\tfor (let i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\tconst currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t\t\tif (currentSlope === 0) {\n\t\t\t\treturn aGuessT;\n\t\t\t}\n\n\t\t\tconst currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\taGuessT -= currentX / currentSlope;\n\t\t}\n\n\t\treturn aGuessT;\n\t}\n\n\tfunction calcSampleValues() {\n\t\tfor (let i = 0; i < kSplineTableSize; ++i) {\n\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t}\n\t}\n\n\tfunction binarySubdivide(aX, aA, aB) {\n\t\tlet currentX, currentT, i = 0;\n\n\t\tdo {\n\t\t\tcurrentT = aA + (aB - aA) / 2;\n\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\tif (currentX > 0) {\n\t\t\t\taB = currentT;\n\t\t\t} else {\n\t\t\t\taA = currentT;\n\t\t\t}\n\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t\treturn currentT;\n\t}\n\n\tfunction getTForX(aX) {\n\t\tconst lastSample = kSplineTableSize - 1;\n\t\tlet intervalStart = 0,\n\t\t\tcurrentSample = 1;\n\n\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\tintervalStart += kSampleStepSize;\n\t\t}\n\n\t\t--currentSample;\n\n\t\tconst dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\n\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t} else if (initialSlope === 0) {\n\t\t\treturn guessForT;\n\t\t} else {\n\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t}\n\t}\n\n\tlet precomputed = false;\n\n\tfunction precompute() {\n\t\tprecomputed = true;\n\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\tcalcSampleValues();\n\t\t}\n\t}\n\n\tconst str = `generateBezier(${[mX1, mY1, mX2, mY2]})`,\n\t\tf = (percentComplete: number, startValue: number, endValue: number, property?: string) => {\n\t\t\tif (!precomputed) {\n\t\t\t\tprecompute();\n\t\t\t}\n\t\t\tif (percentComplete === 0) {\n\t\t\t\treturn startValue;\n\t\t\t}\n\t\t\tif (percentComplete === 1) {\n\t\t\t\treturn endValue;\n\t\t\t}\n\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\treturn startValue + percentComplete * (endValue - startValue);\n\t\t\t}\n\n\t\t\treturn startValue + calcBezier(getTForX(percentComplete), mY1, mY2) * (endValue - startValue);\n\t\t};\n\n\t(f as any).getControlPoints = () => {\n\t\treturn [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }];\n\t};\n\tf.toString = () => {\n\t\treturn str;\n\t};\n\n\treturn f;\n}\n\n/* Common easings */\nconst easeIn = generateBezier(0.42, 0, 1, 1),\n\teaseOut = generateBezier(0, 0, 0.58, 1),\n\teaseInOut = generateBezier(0.42, 0, 0.58, 1);\n\nregisterEasing([\"ease\", generateBezier(0.25, 0.1, 0.25, 1)]);\nregisterEasing([\"easeIn\", easeIn]);\nregisterEasing([\"ease-in\", easeIn]);\nregisterEasing([\"easeOut\", easeOut]);\nregisterEasing([\"ease-out\", easeOut]);\nregisterEasing([\"easeInOut\", easeInOut]);\nregisterEasing([\"ease-in-out\", easeInOut]);\nregisterEasing([\"easeInSine\", generateBezier(0.47, 0, 0.745, 0.715)]);\nregisterEasing([\"easeOutSine\", generateBezier(0.39, 0.575, 0.565, 1)]);\nregisterEasing([\"easeInOutSine\", generateBezier(0.445, 0.05, 0.55, 0.95)]);\nregisterEasing([\"easeInQuad\", generateBezier(0.55, 0.085, 0.68, 0.53)]);\nregisterEasing([\"easeOutQuad\", generateBezier(0.25, 0.46, 0.45, 0.94)]);\nregisterEasing([\"easeInOutQuad\", generateBezier(0.455, 0.03, 0.515, 0.955)]);\nregisterEasing([\"easeInCubic\", generateBezier(0.55, 0.055, 0.675, 0.19)]);\nregisterEasing([\"easeOutCubic\", generateBezier(0.215, 0.61, 0.355, 1)]);\nregisterEasing([\"easeInOutCubic\", generateBezier(0.645, 0.045, 0.355, 1)]);\nregisterEasing([\"easeInQuart\", generateBezier(0.895, 0.03, 0.685, 0.22)]);\nregisterEasing([\"easeOutQuart\", generateBezier(0.165, 0.84, 0.44, 1)]);\nregisterEasing([\"easeInOutQuart\", generateBezier(0.77, 0, 0.175, 1)]);\nregisterEasing([\"easeInQuint\", generateBezier(0.755, 0.05, 0.855, 0.06)]);\nregisterEasing([\"easeOutQuint\", generateBezier(0.23, 1, 0.32, 1)]);\nregisterEasing([\"easeInOutQuint\", generateBezier(0.86, 0, 0.07, 1)]);\nregisterEasing([\"easeInExpo\", generateBezier(0.95, 0.05, 0.795, 0.035)]);\nregisterEasing([\"easeOutExpo\", generateBezier(0.19, 1, 0.22, 1)]);\nregisterEasing([\"easeInOutExpo\", generateBezier(1, 0, 0, 1)]);\nregisterEasing([\"easeInCirc\", generateBezier(0.6, 0.04, 0.98, 0.335)]);\nregisterEasing([\"easeOutCirc\", generateBezier(0.075, 0.82, 0.165, 1)]);\nregisterEasing([\"easeInOutCirc\", generateBezier(0.785, 0.135, 0.15, 0.86)]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {VelocityEasingFn} from \"../../../velocity.d\";\n\ninterface springState {\n\tx: number;\n\tv: number;\n\ttension: number;\n\tfriction: number;\n}\n\ninterface springDelta {\n\tdx: number;\n\tdv: number;\n}\n\n/* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\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\n then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\nfunction springAccelerationForState(state: springState) {\n\treturn (-state.tension * state.x) - (state.friction * state.v);\n}\n\nfunction springEvaluateStateWithDerivative(initialState: springState, dt: number, derivative: springDelta): springDelta {\n\tconst state = {\n\t\tx: initialState.x + derivative.dx * dt,\n\t\tv: initialState.v + derivative.dv * dt,\n\t\ttension: initialState.tension,\n\t\tfriction: initialState.friction,\n\t};\n\n\treturn {\n\t\tdx: state.v,\n\t\tdv: springAccelerationForState(state),\n\t};\n}\n\nfunction springIntegrateState(state: springState, dt: number) {\n\tconst a = {\n\t\tdx: state.v,\n\t\tdv: springAccelerationForState(state),\n\t},\n\t\tb = springEvaluateStateWithDerivative(state, dt * 0.5, a),\n\t\tc = springEvaluateStateWithDerivative(state, dt * 0.5, b),\n\t\td = springEvaluateStateWithDerivative(state, dt, c),\n\t\tdxdt = 1 / 6 * (a.dx + 2 * (b.dx + c.dx) + d.dx),\n\t\tdvdt = 1 / 6 * (a.dv + 2 * (b.dv + c.dv) + d.dv);\n\n\tstate.x = state.x + dxdt * dt;\n\tstate.v = state.v + dvdt * dt;\n\n\treturn state;\n}\n\nexport function generateSpringRK4(tension: number, friction: number): number;\nexport function generateSpringRK4(tension: number, friction: number, duration: number): VelocityEasingFn;\nexport function generateSpringRK4(tension: number, friction: number, duration?: number): any {\n\tconst initState: springState = {\n\t\tx: -1,\n\t\tv: 0,\n\t\ttension: parseFloat(tension as any) || 500,\n\t\tfriction: parseFloat(friction as any) || 20,\n\t},\n\t\tpath = [0],\n\t\ttolerance = 1 / 10000,\n\t\tDT = 16 / 1000,\n\t\thaveDuration = duration != null; // deliberate \"==\", as undefined == null != 0\n\tlet timeLapsed = 0,\n\t\tdt: number,\n\t\tlastState: springState;\n\n\t/* Calculate the actual time it takes for this animation to complete with the provided conditions. */\n\tif (haveDuration) {\n\t\t/* Run the simulation without a duration. */\n\t\ttimeLapsed = generateSpringRK4(initState.tension, initState.friction);\n\t\t/* Compute the adjusted time delta. */\n\t\tdt = (timeLapsed as number) / duration * DT;\n\t} else {\n\t\tdt = DT;\n\t}\n\n\twhile (true) {\n\t\t/* Next/step function .*/\n\t\tlastState = springIntegrateState(lastState || initState, dt);\n\t\t/* Store the position. */\n\t\tpath.push(1 + lastState.x);\n\t\ttimeLapsed += 16;\n\t\t/* If the change threshold is reached, break. */\n\t\tif (!(Math.abs(lastState.x) > tolerance && Math.abs(lastState.v) > tolerance)) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\n\t computed path and returns a snapshot of the position according to a given percentComplete. */\n\treturn !haveDuration ? timeLapsed : (percentComplete: number, startValue: number, endValue: number) => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\n\t\treturn startValue + path[Math.floor(percentComplete * (path.length - 1))] * (endValue - startValue);\n\t};\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details\n *\n * Step easing generator.\n */\n\n// Typedefs\nimport {VelocityEasingFn} from \"../../../velocity.d\";\n\n// Constants\nconst cache: {[steps: number]: VelocityEasingFn} = {};\n\nexport function generateStep(steps): VelocityEasingFn {\n\tconst fn = cache[steps];\n\n\tif (fn) {\n\t\treturn fn;\n\t}\n\n\treturn cache[steps] = (percentComplete: number, startValue: number, endValue: number) => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\n\t\treturn startValue + Math.round(percentComplete * steps) * (1 / steps) * (endValue - startValue);\n\t};\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Validation functions used for various types of data that can be supplied.\n * All errors are reported in the non-minified version for development. If a\n * validation fails then it should return <code>undefined</code>.\n */\n\n// Typedefs\nimport {VelocityCallbackFn, VelocityEasingFn, VelocityEasingType, VelocityProgressFn} from \"../../velocity.d\";\n\n// Project\nimport {Duration} from \"../constants\";\nimport {isBoolean, isFunction, isNumber, isString} from \"../types\";\nimport {generateBezier} from \"./easing/bezier\";\nimport {Easings} from \"./easing/easings\";\nimport {generateSpringRK4} from \"./easing/spring_rk4\";\nimport {generateStep} from \"./easing/step\";\n\n/**\n * Parse a duration value and return an ms number. Optionally return a\n * default value if the number is not valid.\n */\nexport function parseDuration(duration: \"fast\" | \"normal\" | \"slow\" | number, def?: \"fast\" | \"normal\" | \"slow\" | number): number {\n\tif (isNumber(duration)) {\n\t\treturn duration;\n\t}\n\tif (isString(duration)) {\n\t\treturn Duration[duration.toLowerCase()]\n\t\t\t|| parseFloat(duration.replace(\"ms\", \"\")\n\t\t\t\t.replace(\"s\", \"000\"));\n\t}\n\n\treturn def == null ? undefined : parseDuration(def);\n}\n\n/**\n * Validate a <code>cache</code> option.\n */\nexport function validateCache(value: boolean): boolean {\n\tif (isBoolean(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'cache' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>begin</code> option.\n */\nexport function validateBegin(value: VelocityCallbackFn): VelocityCallbackFn {\n\tif (isFunction(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'begin' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>complete</code> option.\n */\nexport function validateComplete(value: VelocityCallbackFn, noError?: true): VelocityCallbackFn {\n\tif (isFunction(value)) {\n\t\treturn value;\n\t}\n\tif (value != null && !noError) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'complete' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>delay</code> option.\n */\nexport function validateDelay(value: \"fast\" | \"normal\" | \"slow\" | number): number {\n\tconst parsed = parseDuration(value);\n\n\tif (!isNaN(parsed)) {\n\t\treturn parsed;\n\t}\n\tif (value != null) {\n\t\tconsole.error(`VelocityJS: Trying to set 'delay' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>duration</code> option.\n */\nexport function validateDuration(value: \"fast\" | \"normal\" | \"slow\" | number, noError?: true): number {\n\tconst parsed = parseDuration(value);\n\n\tif (!isNaN(parsed) && parsed >= 0) {\n\t\treturn parsed;\n\t}\n\tif (value != null && !noError) {\n\t\tconsole.error(`VelocityJS: Trying to set 'duration' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>easing</code> option.\n */\nexport function validateEasing(value: VelocityEasingType, duration: number, noError?: true): VelocityEasingFn {\n\tif (isString(value)) {\n\t\t// Named easing\n\t\treturn Easings[value];\n\t}\n\tif (isFunction(value)) {\n\t\treturn value;\n\t}\n\t// TODO: We should only do these if the correct function exists - don't force loading.\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 1) {\n\t\t\t// Steps\n\t\t\treturn generateStep(value[0]);\n\t\t}\n\t\tif (value.length === 2) {\n\t\t\t// springRK4 must be passed the animation's duration.\n\t\t\t// Note: If the springRK4 array contains non-numbers,\n\t\t\t// generateSpringRK4() returns an easing function generated with\n\t\t\t// default tension and friction values.\n\t\t\treturn generateSpringRK4(value[0], value[1], duration);\n\t\t}\n\t\tif (value.length === 4) {\n\t\t\t// Note: If the bezier array contains non-numbers, generateBezier()\n\t\t\t// returns undefined.\n\t\t\treturn generateBezier.apply(null, value) || false;\n\t\t}\n\t}\n\tif (value != null && !noError) {\n\t\tconsole.error(`VelocityJS: Trying to set 'easing' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>fpsLimit</code> option.\n */\nexport function validateFpsLimit(value: number | false): number {\n\tif (value === false) {\n\t\treturn 0;\n\t} else {\n\t\tconst parsed = parseInt(value as any, 10);\n\n\t\tif (!isNaN(parsed) && parsed >= 0) {\n\t\t\treturn Math.min(parsed, 60);\n\t\t}\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'fpsLimit' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>loop</code> option.\n */\nexport function validateLoop(value: number | boolean): number | true {\n\tswitch (value) {\n\t\tcase false:\n\t\t\treturn 0;\n\n\t\tcase true:\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\tconst parsed = parseInt(value as any, 10);\n\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\n\t\t\t\treturn parsed;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'loop' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>progress</code> option.\n */\nexport function validateProgress(value: VelocityProgressFn): VelocityProgressFn {\n\tif (isFunction(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'progress' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>promise</code> option.\n */\nexport function validatePromise(value: boolean): boolean {\n\tif (isBoolean(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'promise' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>promiseRejectEmpty</code> option.\n */\nexport function validatePromiseRejectEmpty(value: boolean): boolean {\n\tif (isBoolean(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'promiseRejectEmpty' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>queue</code> option.\n */\nexport function validateQueue(value: string | false, noError?: true): string | false {\n\tif (value === false || isString(value)) {\n\t\treturn value;\n\t}\n\tif (value != null && !noError) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'queue' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>repeat</code> option.\n */\nexport function validateRepeat(value: number | boolean): number | true {\n\tswitch (value) {\n\t\tcase false:\n\t\t\treturn 0;\n\n\t\tcase true:\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\tconst parsed = parseInt(value as any, 10);\n\n\t\t\tif (!isNaN(parsed) && parsed >= 0) {\n\t\t\t\treturn parsed;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\tif (value != null) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'repeat' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>speed</code> option.\n */\nexport function validateSpeed(value: number): number {\n\tif (isNumber(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.error(`VelocityJS: Trying to set 'speed' to an invalid value:`, value);\n\t}\n}\n\n/**\n * Validate a <code>sync</code> option.\n */\nexport function validateSync(value: boolean): boolean {\n\tif (isBoolean(value)) {\n\t\treturn value;\n\t}\n\tif (value != null) {\n\t\tconsole.error(`VelocityJS: Trying to set 'sync' to an invalid value:`, value);\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Velocity option defaults, which can be overriden by the user.\n */\n\n// Typedefs\nimport {StrictVelocityOptions, VelocityCallbackFn, VelocityEasingFn} from \"../../velocity.d\";\n\n// Project\nimport {isBoolean} from \"../types\";\nimport {\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\n\tvalidateEasing, validateFpsLimit, validateLoop, validatePromise, validatePromiseRejectEmpty,\n\tvalidateQueue, validateRepeat, validateSpeed, validateSync,\n} from \"./options\";\n\n// Constants\nimport {\n\tDEFAULT_CACHE, DEFAULT_DELAY, DEFAULT_DURATION, DEFAULT_EASING, DEFAULT_FPSLIMIT,\n\tDEFAULT_LOOP, DEFAULT_PROMISE, DEFAULT_PROMISE_REJECT_EMPTY, DEFAULT_QUEUE, DEFAULT_REPEAT,\n\tDEFAULT_SPEED, DEFAULT_SYNC, FUZZY_MS_PER_SECOND,\n} from \"../constants\";\n\n// NOTE: Add the variable here, then add the default state in \"reset\" below.\nlet cache: boolean,\n\tbegin: VelocityCallbackFn,\n\tcomplete: VelocityCallbackFn,\n\tdelay: number,\n\tduration: number,\n\teasing: VelocityEasingFn,\n\tfpsLimit: number,\n\tloop: number | true,\n\tmobileHA: boolean,\n\tminFrameTime: number,\n\tpromise: boolean,\n\tpromiseRejectEmpty: boolean,\n\tqueue: string | false,\n\trepeat: number | true,\n\tspeed: number,\n\tsync: boolean;\n\nexport abstract class defaults implements StrictVelocityOptions {\n\tstatic reset() {\n\t\tcache = DEFAULT_CACHE;\n\t\tbegin = undefined;\n\t\tcomplete = undefined;\n\t\tdelay = DEFAULT_DELAY;\n\t\tduration = DEFAULT_DURATION;\n\t\teasing = validateEasing(DEFAULT_EASING, DEFAULT_DURATION);\n\t\tfpsLimit = DEFAULT_FPSLIMIT;\n\t\tloop = DEFAULT_LOOP;\n\t\tminFrameTime = FUZZY_MS_PER_SECOND / DEFAULT_FPSLIMIT;\n\t\tpromise = DEFAULT_PROMISE;\n\t\tpromiseRejectEmpty = DEFAULT_PROMISE_REJECT_EMPTY;\n\t\tqueue = DEFAULT_QUEUE;\n\t\trepeat = DEFAULT_REPEAT;\n\t\tspeed = DEFAULT_SPEED;\n\t\tsync = DEFAULT_SYNC;\n\t}\n\n\tstatic get cache(): boolean {\n\t\treturn cache;\n\t}\n\n\tstatic set cache(value: boolean) {\n\t\tvalue = validateCache(value);\n\t\tif (value !== undefined) {\n\t\t\tcache = value;\n\t\t}\n\t}\n\n\tstatic get begin(): VelocityCallbackFn {\n\t\treturn begin;\n\t}\n\tstatic set begin(value: VelocityCallbackFn) {\n\t\tvalue = validateBegin(value);\n\t\tif (value !== undefined) {\n\t\t\tbegin = value;\n\t\t}\n\t}\n\n\tstatic get complete(): VelocityCallbackFn {\n\t\treturn complete;\n\t}\n\n\tstatic set complete(value: VelocityCallbackFn) {\n\t\tvalue = validateComplete(value);\n\t\tif (value !== undefined) {\n\t\t\tcomplete = value;\n\t\t}\n\t}\n\n\tstatic get delay(): number {\n\t\treturn delay;\n\t}\n\tstatic set delay(value: number) {\n\t\tvalue = validateDelay(value);\n\t\tif (value !== undefined) {\n\t\t\tdelay = value;\n\t\t}\n\t}\n\n\tstatic get duration(): number {\n\t\treturn duration;\n\t}\n\tstatic set duration(value: number) {\n\t\tvalue = validateDuration(value);\n\t\tif (value !== undefined) {\n\t\t\tduration = value;\n\t\t}\n\t}\n\n\tstatic get easing(): VelocityEasingFn {\n\t\treturn easing;\n\t}\n\tstatic set easing(value: VelocityEasingFn) {\n\t\tvalue = validateEasing(value, duration);\n\t\tif (value !== undefined) {\n\t\t\teasing = value;\n\t\t}\n\t}\n\n\tstatic get fpsLimit(): number | false {\n\t\treturn fpsLimit;\n\t}\n\tstatic set fpsLimit(value: number | false) {\n\t\tvalue = validateFpsLimit(value);\n\t\tif (value !== undefined) {\n\t\t\tfpsLimit = value;\n\t\t\tminFrameTime = FUZZY_MS_PER_SECOND / value;\n\t\t}\n\t}\n\n\tstatic get loop(): number | true {\n\t\treturn loop;\n\t}\n\tstatic set loop(value: number | true) {\n\t\tvalue = validateLoop(value);\n\t\tif (value !== undefined) {\n\t\t\tloop = value;\n\t\t}\n\t}\n\n\tstatic get mobileHA(): boolean {\n\t\treturn mobileHA;\n\t}\n\tstatic set mobileHA(value: boolean) {\n\t\tif (isBoolean(value)) {\n\t\t\tmobileHA = value;\n\t\t}\n\t}\n\n\tstatic get minFrameTime(): number | false {\n\t\treturn minFrameTime;\n\t}\n\n\tstatic get promise(): boolean {\n\t\treturn promise;\n\t}\n\tstatic set promise(value: boolean) {\n\t\tvalue = validatePromise(value);\n\t\tif (value !== undefined) {\n\t\t\tpromise = value;\n\t\t}\n\t}\n\n\tstatic get promiseRejectEmpty(): boolean {\n\t\treturn promiseRejectEmpty;\n\t}\n\tstatic set promiseRejectEmpty(value: boolean) {\n\t\tvalue = validatePromiseRejectEmpty(value);\n\t\tif (value !== undefined) {\n\t\t\tpromiseRejectEmpty = value;\n\t\t}\n\t}\n\n\tstatic get queue(): string | false {\n\t\treturn queue;\n\t}\n\tstatic set queue(value: string | false) {\n\t\tvalue = validateQueue(value);\n\t\tif (value !== undefined) {\n\t\t\tqueue = value;\n\t\t}\n\t}\n\n\tstatic get repeat(): number | true {\n\t\treturn repeat;\n\t}\n\tstatic set repeat(value: number | true) {\n\t\tvalue = validateRepeat(value);\n\t\tif (value !== undefined) {\n\t\t\trepeat = value;\n\t\t}\n\t}\n\n\tstatic get repeatAgain(): number | true {\n\t\treturn repeat;\n\t}\n\n\tstatic get speed(): number {\n\t\treturn speed;\n\t}\n\tstatic set speed(value: number) {\n\t\tvalue = validateSpeed(value);\n\t\tif (value !== undefined) {\n\t\t\tspeed = value;\n\t\t}\n\t}\n\tstatic get sync(): boolean {\n\t\treturn sync;\n\t}\n\tstatic set sync(value: boolean) {\n\t\tvalue = validateSync(value);\n\t\tif (value !== undefined) {\n\t\t\tsync = value;\n\t\t}\n\t}\n}\n\nObject.freeze(defaults);\n\n// Reset to our default values, currently everything is undefined.\ndefaults.reset();\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Normalisations are used when getting or setting a (normally css compound\n * properties) value that can have a different order in different browsers.\n *\n * It can also be used to extend and create specific properties that otherwise\n * don't exist (such as for scrolling, or inner/outer dimensions).\n */\n\n// Typedefs\nimport {VelocityNormalizationsFn} from \"../../../velocity.d\";\n\n/**\n * The highest type index for finding the best normalization for a property.\n */\nexport let MaxType: number = -1;\n\n/**\n * Unlike \"actions\", normalizations can always be replaced by users.\n */\nexport const Normalizations: {[name: string]: VelocityNormalizationsFn}[] = [];\n\n/**\n * Store a cross-reference to units to be added to specific normalization\n * functions if the user supplies a unit-less number.\n *\n * This is pretty much confined to adding \"px\" to several css properties.\n */\nexport const NormalizationUnits: {[unit: string]: VelocityNormalizationsFn[]} = {};\n\n/**\n * Any normalisations that should never be cached are listed here.\n * Faster than an array - https://jsperf.com/array-includes-and-find-methods-vs-set-has\n */\nexport const NoCacheNormalizations = new Set<string>();\n\n/**\n * Used to define a constructor.\n */\nexport interface ClassConstructor {\n\tnew(): object;\n}\n\n/**\n * An array of classes used for the per-class normalizations. This\n * translates into a bitwise enum for quick cross-reference, and so that\n * the element doesn't need multiple <code>instanceof</code> calls every\n * frame.\n */\nexport const constructors: (ClassConstructor | string)[] = [];\n\n/**\n * A cache of the various constructors we've found and mapping to their real\n * name - saves expensive lookups.\n */\nexport const constructorCache = new Map<ClassConstructor, ClassConstructor | string>();\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {ElementData, HTMLorSVGElement} from \"../../velocity.d\";\n\n// Project\nimport {isString} from \"../types\";\nimport {constructors} from \"./normalizations/normalizationsObject\";\n\n// Constants\nconst dataName = \"velocityData\";\n\n/**\n * Get (and create) the internal data store for an element.\n */\nexport function Data(element: HTMLorSVGElement): ElementData {\n\t// Use a string member so Uglify doesn't mangle it.\n\tconst data = element[dataName];\n\n\tif (data) {\n\t\treturn data;\n\t}\n\tconst window = element.ownerDocument.defaultView;\n\tlet types = 0;\n\n\tfor (let index = 0; index < constructors.length; index++) {\n\t\tconst constructor = constructors[index];\n\n\t\tif (isString(constructor)) {\n\t\t\tif (element instanceof window[constructor]) {\n\t\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\n\t\t\t}\n\t\t} else if (element instanceof constructor) {\n\t\t\ttypes |= 1 << index; // tslint:disable-line:no-bitwise\n\t\t}\n\t}\n\t// Use an intermediate object so it errors on incorrect data.\n\tconst newData: ElementData = {\n\t\ttypes,\n\t\tcount: 0,\n\t\tcomputedStyle: null,\n\t\tcache: {} as any,\n\t\tqueueList: {},\n\t\tlastAnimationList: {},\n\t\tlastFinishList: {},\n\t\twindow,\n\t};\n\n\tObject.defineProperty(element, dataName, {\n\t\tvalue: newData,\n\t});\n\n\treturn newData;\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {VelocityState} from \"../../velocity.d\";\n\n// Constants\nimport {CLASSNAME} from \"../constants\";\n\nconst isClient = window && window === window.window,\n\twindowScrollAnchor = isClient && window.pageYOffset !== undefined;\n\nexport const State: VelocityState = {\n\tisClient,\n\tisMobile: isClient && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\n\tisGingerbread: isClient && /Android 2\\.3\\.[3-7]/i.test(navigator.userAgent),\n\tprefixElement: isClient && document.createElement(\"div\"),\n\twindowScrollAnchor,\n\tscrollAnchor: windowScrollAnchor ? window : (!isClient || document.documentElement || document.body.parentNode || document.body),\n\tscrollPropertyLeft: windowScrollAnchor ? \"pageXOffset\" : \"scrollLeft\",\n\tscrollPropertyTop: windowScrollAnchor ? \"pageYOffset\" : \"scrollTop\",\n\tclassName: CLASSNAME,\n\tisTicking: false,\n\tfirst: undefined,\n\tlast: undefined,\n\tfirstNew: undefined,\n};\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * AnimationCall queue\n */\n\n// Typedefs\nimport {AnimationCall, HTMLorSVGElement} from \"../../velocity.d\";\n\n// Project\nimport {isString} from \"../types\";\nimport {addClass} from \"../utility\";\nimport {Data} from \"./data\";\nimport {State} from \"./state\";\n\n/**\n * Simple queue management. Un-named queue is directly within the element data,\n * named queue is within an object within it.\n */\nfunction animate(animation: AnimationCall) {\n\tconst prev = State.last;\n\n\tanimation._prev = prev;\n\tanimation._next = undefined;\n\tif (prev) {\n\t\tprev._next = animation;\n\t} else {\n\t\tState.first = animation;\n\t}\n\tState.last = animation;\n\tif (!State.firstNew) {\n\t\tState.firstNew = animation;\n\t}\n\tconst element = animation.element,\n\t\tdata = Data(element);\n\n\tif (!data.count++) {\n\n\t\t////////////////////////\n\t\t// Feature: Classname //\n\t\t////////////////////////\n\n\t\taddClass(element, State.className);\n\t}\n}\n\n/**\n * Add an item to an animation queue.\n */\nexport function queue(element: HTMLorSVGElement, animation: AnimationCall, queueName: string | false): void {\n\tconst data = Data(element);\n\n\tif (queueName !== false) {\n\t\t// Store the last animation added so we can use it for the\n\t\t// beginning of the next one.\n\t\tdata.lastAnimationList[queueName] = animation;\n\t}\n\tif (queueName === false) {\n\t\tanimate(animation);\n\t} else {\n\t\tif (!isString(queueName)) {\n\t\t\tqueueName = \"\";\n\t\t}\n\t\tlet last = data.queueList[queueName];\n\n\t\tif (!last) {\n\t\t\tif (last === null) {\n\t\t\t\tdata.queueList[queueName] = animation;\n\t\t\t} else {\n\t\t\t\tdata.queueList[queueName] = null;\n\t\t\t\tanimate(animation);\n\t\t\t}\n\t\t} else {\n\t\t\twhile (last._next) {\n\t\t\t\tlast = last._next;\n\t\t\t}\n\t\t\tlast._next = animation;\n\t\t\tanimation._prev = last;\n\t\t}\n\t}\n}\n\n/**\n * Start the next animation on this element's queue (named or default).\n *\n * @returns the next animation that is starting.\n */\nexport function dequeue(element: HTMLorSVGElement, queueName?: string | boolean, skip?: boolean): AnimationCall {\n\tif (queueName !== false) {\n\t\tif (!isString(queueName)) {\n\t\t\tqueueName = \"\";\n\t\t}\n\t\tconst data = Data(element),\n\t\t\tanimation = data.queueList[queueName];\n\n\t\tif (animation) {\n\t\t\tdata.queueList[queueName] = animation._next || null;\n\t\t\tif (!skip) {\n\t\t\t\tanimate(animation);\n\t\t\t}\n\t\t} else if (animation === null) {\n\t\t\tdelete data.queueList[queueName];\n\t\t}\n\n\t\treturn animation;\n\t}\n}\n\n/**\n * Remove an animation from the active animation list. If it has a queue set\n * then remember it as the last animation for that queue, and free the one\n * that was previously there. If the animation list is completely empty then\n * mark us as finished.\n */\nexport function freeAnimationCall(animation: AnimationCall): void {\n\tconst next = animation._next,\n\t\tprev = animation._prev,\n\t\tqueueName = animation.queue == null ? animation.options.queue : animation.queue;\n\n\tif (State.firstNew === animation) {\n\t\tState.firstNew = next;\n\t}\n\tif (State.first === animation) {\n\t\tState.first = next;\n\t} else if (prev) {\n\t\tprev._next = next;\n\t}\n\tif (State.last === animation) {\n\t\tState.last = prev;\n\t} else if (next) {\n\t\tnext._prev = prev;\n\t}\n\tif (queueName) {\n\t\tconst data = Data(animation.element);\n\n\t\tif (data) {\n\t\t\tanimation._next = animation._prev = undefined;\n\t\t}\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {SequenceList} from \"../../velocity.d\";\n\nexport const SequencesObject: {[name: string]: SequenceList} = {};\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Call Completion\n */\n\n// Typedefs\nimport {AnimationCall, AnimationFlags} from \"../../velocity.d\";\n\n// Project\nimport {getValue, removeClass} from \"../utility\";\nimport {Data} from \"./data\";\nimport {defaults} from \"./defaults\";\nimport {dequeue, freeAnimationCall} from \"./queue\";\nimport {State} from \"./state\";\n\n/**\n * Call the complete method of an animation in a separate function so it can\n * benefit from JIT compiling while still having a try/catch block.\n */\nfunction callComplete(activeCall: AnimationCall) {\n\tconst callback = activeCall.complete || activeCall.options.complete;\n\n\tif (callback) {\n\t\ttry {\n\t\t\tconst elements = activeCall.elements;\n\n\t\t\tcallback.call(elements, elements, activeCall);\n\t\t} catch (error) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthrow error;\n\t\t\t}, 1);\n\t\t}\n\t}\n}\n\n/**\n * Complete an animation. This might involve restarting (for loop or repeat\n * options). Once it is finished we also check for any callbacks or Promises\n * that need updating.\n */\nexport function completeCall(activeCall: AnimationCall) {\n\t// TODO: Check if it's not been completed already\n\tconst options = activeCall.options,\n\t\tqueue = getValue(activeCall.queue, options.queue),\n\t\tisLoop = getValue(activeCall.loop, options.loop, defaults.loop),\n\t\tisRepeat = getValue(activeCall.repeat, options.repeat, defaults.repeat),\n\t\tisStopped = activeCall._flags & AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\n\n\tif (!isStopped && (isLoop || isRepeat)) {\n\n\t\t////////////////////\n\t\t// Option: Loop //\n\t\t// Option: Repeat //\n\t\t////////////////////\n\n\t\tif (isRepeat && isRepeat !== true) {\n\t\t\tactiveCall.repeat = isRepeat - 1;\n\t\t} else if (isLoop && isLoop !== true) {\n\t\t\tactiveCall.loop = isLoop - 1;\n\t\t\tactiveCall.repeat = getValue(activeCall.repeatAgain, options.repeatAgain, defaults.repeatAgain);\n\t\t}\n\t\tif (isLoop) {\n\t\t\tactiveCall._flags ^= AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\n\t\t}\n\t\tif (queue !== false) {\n\t\t\t// Can't be called when stopped so no need for an extra check.\n\t\t\tData(activeCall.element).lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\n\t\t}\n\t\tactiveCall.timeStart = activeCall.ellapsedTime = activeCall.percentComplete = 0;\n\t\tactiveCall._flags &= ~AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\n\t} else {\n\t\tconst element = activeCall.element,\n\t\t\tdata = Data(element);\n\n\t\tif (!--data.count && !isStopped) {\n\n\t\t\t////////////////////////\n\t\t\t// Feature: Classname //\n\t\t\t////////////////////////\n\n\t\t\tremoveClass(element, State.className);\n\t\t}\n\n\t\t//////////////////////\n\t\t// Option: Complete //\n\t\t//////////////////////\n\n\t\t// If this is the last animation in this list then we can check for\n\t\t// and complete calls or Promises.\n\t\t// TODO: When deleting an element we need to adjust these values.\n\t\tif (options && ++options._completed === options._total) {\n\t\t\tif (!isStopped && options.complete) {\n\t\t\t\t// We don't call the complete if the animation is stopped,\n\t\t\t\t// and we clear the key to prevent it being called again.\n\t\t\t\tcallComplete(activeCall);\n\t\t\t\toptions.complete = null;\n\t\t\t}\n\t\t\tconst resolver = options._resolver;\n\n\t\t\tif (resolver) {\n\t\t\t\t// Fulfil the Promise\n\t\t\t\tresolver(activeCall.elements as any);\n\t\t\t\tdelete options._resolver;\n\t\t\t}\n\t\t}\n\n\t\t///////////////////\n\t\t// Option: Queue //\n\t\t///////////////////\n\n\t\tif (queue !== false) {\n\t\t\t// We only do clever things with queues...\n\t\t\tif (!isStopped) {\n\t\t\t\t// If we're not stopping an animation, we need to remember\n\t\t\t\t// what time it finished so that the next animation in\n\t\t\t\t// sequence gets the correct start time.\n\t\t\t\tdata.lastFinishList[queue] = activeCall.timeStart + getValue(activeCall.duration, options.duration, defaults.duration);\n\t\t\t}\n\t\t\t// Start the next animation in sequence, or delete the queue if\n\t\t\t// this was the last one.\n\t\t\tdequeue(element, queue);\n\t\t}\n\t\t// Cleanup any pointers, and remember the last animation etc.\n\t\tfreeAnimationCall(activeCall);\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Normalisations are used when getting or setting a (normally css compound\n * properties) value that can have a different order in different browsers.\n *\n * It can also be used to extend and create specific properties that otherwise\n * don't exist (such as for scrolling, or inner/outer dimensions).\n */\n\n// Typedefs\nimport { HTMLorSVGElement, VelocityNormalizationsFn } from \"../../../velocity.d\";\n\n// Project\nimport { isFunction, isString } from \"../../types\";\nimport { registerAction } from \"../actions/actions\";\nimport { Data } from \"../data\";\nimport { ClassConstructor, constructorCache, constructors, NoCacheNormalizations, Normalizations, NormalizationUnits } from \"./normalizationsObject\";\n\n/**\n * Used to register a normalization. This should never be called by users\n * directly, instead it should be called via an action:<br/>\n * <code>Velocity(\"registerNormalization\", \"Element\", \"name\", VelocityNormalizationsFn[, false]);</code>\n *\n * The second argument is the class of the animatable object. If this is passed\n * as a class name (ie, `\"Element\"` -> `window[\"Element\"]`) then this will work\n * cross-iframe. If passed as an actual class (ie `Element`) then it will\n * attempt to find the class on the window and use that name instead. If it\n * can't find it then it will use the class passed, which allows for custom\n * animation targets, but will not work cross-iframe boundary.\n *\n * The fourth argument can be an explicit <code>false</code>, which prevents\n * the property from being cached. Please note that this can be dangerous\n * for performance!\n */\nexport function registerNormalization(\n\targs?: [ClassConstructor | string, string, VelocityNormalizationsFn]\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, boolean]\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string]\n\t\t| [ClassConstructor | string, string, VelocityNormalizationsFn, string, boolean]) {\n\tconst constructor = args[0],\n\t\tname: string = args[1],\n\t\tcallback = args[2];\n\n\tif ((isString(constructor) && !(window[constructor] instanceof Object))\n\t\t|| (!isString(constructor) && !(constructor instanceof Object))) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' constructor to an invalid value:`, constructor);\n\t} else if (!isString(name)) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' name to an invalid value:`, name);\n\t} else if (!isFunction(callback)) {\n\t\tconsole.warn(`VelocityJS: Trying to set 'registerNormalization' callback to an invalid value:`, name, callback);\n\t} else {\n\t\tlet index = constructors.indexOf(constructor),\n\t\t\tnextArg = 3;\n\n\t\tif (index < 0 && !isString(constructor)) {\n\t\t\tif (constructorCache.has(constructor)) {\n\t\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\n\t\t\t} else {\n\t\t\t\tfor (const property in window) {\n\t\t\t\t\tif ((window[property] as any) === constructor) {\n\t\t\t\t\t\tindex = constructors.indexOf(property);\n\t\t\t\t\t\tif (index < 0) {\n\t\t\t\t\t\t\tindex = constructors.push(property) - 1;\n\t\t\t\t\t\t\tNormalizations[index] = {};\n\t\t\t\t\t\t\tconstructorCache.set(constructor, property);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (index < 0) {\n\t\t\tindex = constructors.push(constructor) - 1;\n\t\t\tNormalizations[index] = {};\n\t\t}\n\t\tNormalizations[index][name] = callback;\n\t\tif (isString(args[nextArg])) {\n\t\t\tconst unit = args[nextArg++] as string;\n\t\t\tlet units = NormalizationUnits[unit];\n\n\t\t\tif (!units) {\n\t\t\t\tunits = NormalizationUnits[unit] = [];\n\t\t\t}\n\t\t\tunits.push(callback);\n\t\t}\n\t\tif (args[nextArg] === false) {\n\t\t\tNoCacheNormalizations.add(name);\n\t\t}\n\t}\n}\n\n/**\n * Used to check if a normalisation exists on a specific class.\n */\nexport function hasNormalization(args?: [ClassConstructor | string, string]): boolean {\n\tconst constructor = args[0],\n\t\tname: string = args[1];\n\tlet index = constructors.indexOf(constructor);\n\n\tif (index < 0 && !isString(constructor)) {\n\t\tif (constructorCache.has(constructor)) {\n\t\t\tindex = constructors.indexOf(constructorCache.get(constructor));\n\t\t} else {\n\t\t\tfor (const property in window) {\n\t\t\t\tif ((window[property] as any) === constructor) {\n\t\t\t\t\tindex = constructors.indexOf(property);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index >= 0 && Normalizations[index].hasOwnProperty(name);\n}\n\n/**\n * Get the unit to add to a unitless number based on the normalization used.\n */\nexport function getNormalizationUnit(fn: VelocityNormalizationsFn) {\n\tfor (const unit in NormalizationUnits) {\n\t\tif (NormalizationUnits[unit].includes(fn)) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn \"\";\n}\n\n/**\n * Get the normalization for an element and propertyName combination. This\n * value should be cached at asking time, as it may change if the user adds\n * more normalizations.\n */\nexport function getNormalization(element: HTMLorSVGElement, propertyName: string) {\n\tconst data = Data(element);\n\tlet fn: VelocityNormalizationsFn;\n\n\tfor (let index = constructors.length - 1, types = data.types; !fn && index >= 0; index--) {\n\t\tif (types & (1 << index)) { // tslint:disable-line:no-bitwise\n\t\t\tfn = Normalizations[index][propertyName];\n\t\t}\n\t}\n\n\treturn fn;\n}\n\nregisterAction([\"registerNormalization\", registerNormalization]);\nregisterAction([\"hasNormalization\", hasNormalization]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\n\n// Project\nimport Velocity from \"../../velocity\";\nimport {Data} from \"../data\";\nimport {getNormalization} from \"../normalizations/normalizations\";\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\n\n/**\n * The singular setPropertyValue, which routes the logic for all\n * normalizations.\n */\nexport function setPropertyValue(element: HTMLorSVGElement, propertyName: string, propertyValue: any, fn?: VelocityNormalizationsFn) {\n\tconst noCache = NoCacheNormalizations.has(propertyName),\n\t\tdata = !noCache && Data(element);\n\n\tif (noCache || (data && data.cache[propertyName] !== propertyValue)) {\n\t\t// By setting it to undefined we force a true \"get\" later\n\t\tif (!noCache) {\n\t\t\tdata.cache[propertyName] = propertyValue || undefined;\n\t\t}\n\t\tfn = fn || getNormalization(element, propertyName);\n\t\tif (fn) {\n\t\t\tfn(element, propertyValue);\n\t\t}\n\t\tif (Velocity.debug >= 2) {\n\t\t\tconsole.info(`Set \"${propertyName}\": \"${propertyValue}\"`, element);\n\t\t}\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n/**\n * Remove nested `calc(0px + *)` or `calc(* + (0px + *))` correctly.\n */\nexport function removeNestedCalc(value: string): string {\n\tif (value.indexOf(\"calc(\") >= 0) {\n\t\tconst tokens = value.split(/([\\(\\)])/);\n\t\tlet depth = 0;\n\n\t\tfor (let i = 0; i < tokens.length; i++) {\n\t\t\tconst token = tokens[i];\n\n\t\t\tswitch (token) {\n\t\t\t\tcase \"(\":\n\t\t\t\t\tdepth++;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \")\":\n\t\t\t\t\tdepth--;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif (depth && token[0] === \"0\") {\n\t\t\t\t\t\ttokens[i] = token.replace(/^0[a-z%]+ \\+ /, \"\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn tokens.join(\"\")\n\t\t\t.replace(/(?:calc)?\\(([0-9\\.]+[a-z%]+)\\)/g, \"$1\");\n\t}\n\n\treturn value;\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n/**\n * Cache every camelCase match to avoid repeating lookups.\n */\nconst cache: {[property: string]: string} = {};\n\n/**\n * Camelcase a property name into its JavaScript notation (e.g.\n * \"background-color\" ==> \"backgroundColor\"). Camelcasing is used to\n * normalize property names between and across calls.\n */\nexport function camelCase(property: string): string {\n\tconst fixed = cache[property];\n\n\tif (fixed) {\n\t\treturn fixed;\n\t}\n\n\treturn cache[property] = property.replace(/-([a-z])/g, ($: string, letter: string) => letter.toUpperCase());\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Constants\nconst rxColor6 = /#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/gi,\n\trxColor3 = /#([a-f\\d])([a-f\\d])([a-f\\d])/gi,\n\trxColorName = /(rgba?\\(\\s*)?(\\b[a-z]+\\b)/g,\n\trxRGB = /rgb(a?)\\(([^\\)]+)\\)/gi,\n\trxSpaces = /\\s+/g;\n\n/**\n * This is the list of color names -> rgb values. The object is in here so\n * that the actual name conversion can be in a separate file and not\n * included for custom builds.\n */\nexport const ColorNames: {[name: string]: string} = {};\n\n/**\n * Convert a hex list to an rgba value. Designed to be used in replace.\n */\nfunction makeRGBA(ignore: any, r: string, g: string, b: string): string {\n\treturn `rgba(${parseInt(r, 16)},${parseInt(g, 16)},${parseInt(b, 16)},1)`;\n}\n\n/**\n * Replace any css colour name with its rgba() value. It is possible to use\n * the name within an \"rgba(blue, 0.4)\" string this way.\n */\nexport function fixColors(str: string): string {\n\treturn str\n\t\t.replace(rxColor6, makeRGBA)\n\t\t.replace(rxColor3, ($0, r, g, b) => {\n\t\t\treturn makeRGBA($0, r + r, g + g, b + b);\n\t\t})\n\t\t.replace(rxColorName, ($0, $1, $2) => {\n\t\t\tif (ColorNames[$2]) {\n\t\t\t\treturn ($1 ? $1 : \"rgba(\") + ColorNames[$2] + ($1 ? \"\" : \",1)\");\n\t\t\t}\n\n\t\t\treturn $0;\n\t\t})\n\t\t.replace(rxRGB, ($0, $1, $2: string) => {\n\t\t\treturn `rgba(${$2.replace(rxSpaces, \"\") + ($1 ? \"\" : \",1\")})`;\n\t\t});\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\n\n// Project\nimport {getPropertyValue} from \"./getPropertyValue\";\n\n/**\n * Figure out the dimensions for this width / height based on the\n * potential borders and whether we care about them.\n */\nexport function augmentDimension(element: HTMLorSVGElement, name: \"width\" | \"height\", wantInner: boolean): number {\n\tconst isBorderBox = getPropertyValue(element, \"boxSizing\")\n\t\t.toString()\n\t\t.toLowerCase() === \"border-box\";\n\n\tif (isBorderBox === wantInner) {\n\t\t// in box-sizing mode, the CSS width / height accessors already\n\t\t// give the outerWidth / outerHeight.\n\t\tconst sides = name === \"width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\n\t\t\tfields = [`padding${sides[0]}`, `padding${sides[1]}`, `border${sides[0]}Width`, `border${sides[1]}Width`];\n\t\tlet augment = 0;\n\n\t\tfor (const field of fields) {\n\t\t\tconst value = parseFloat(getPropertyValue(element, field));\n\n\t\t\tif (!isNaN(value)) {\n\t\t\t\taugment += value;\n\t\t\t}\n\t\t}\n\n\t\treturn wantInner ? -augment : augment;\n\t}\n\n\treturn 0;\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\n\n// Project\nimport Velocity from \"../../velocity\";\nimport {Data} from \"../data\";\nimport {getNormalization} from \"../normalizations/normalizations\";\nimport {NoCacheNormalizations} from \"../normalizations/normalizationsObject\";\nimport {augmentDimension} from \"./augmentDimension\";\nimport {setPropertyValue} from \"./setPropertyValue\";\n\n/**\n * Get the width or height of an element, pulled out as it can be used when the\n * in two locations so don't want to repeat it.\n */\nfunction getWidthHeight(element: HTMLorSVGElement, property: \"width\" | \"height\"): string {\n\treturn (element.getBoundingClientRect()[property] + augmentDimension(element, property, true)) + \"px\";\n}\n\n// TODO: This is still a complete mess\nexport function computePropertyValue(element: HTMLorSVGElement, property: string): string {\n\tconst data = Data(element),\n\t\t// If computedStyle is cached, use it. If not then get the correct one\n\t\t// for the element to support cross-iframe boundaries.\n\t\tcomputedStyle = data.computedStyle ? data.computedStyle : data.window.getComputedStyle(element, null);\n\tlet computedValue: string | number = 0;\n\n\tif (!data.computedStyle) {\n\t\tdata.computedStyle = computedStyle;\n\t}\n\tif (computedStyle[\"display\"] === \"none\") {\n\t\tswitch (property) {\n\t\t\tcase \"width\":\n\t\t\tcase \"height\":\n\t\t\t\t// Browsers do not return height and width values for elements\n\t\t\t\t// that are set to display:\"none\". Thus, we temporarily toggle\n\t\t\t\t// display to the element type's default value.\n\t\t\t\tsetPropertyValue(element, \"display\", \"auto\");\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\n\t\t\t\tsetPropertyValue(element, \"display\", \"none\");\n\n\t\t\t\treturn String(computedValue);\n\t\t}\n\t}\n\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.\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.\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. */\n\t/* TODO: There is a borderColor normalisation in legacy/ - figure out where this is needed... */\n\n\tcomputedValue = computedStyle[property];\n\t/* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\tif (!computedValue) {\n\t\tcomputedValue = element.style[property];\n\t}\n\t/* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t/* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\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\"). */\n\tif (computedValue === \"auto\") {\n\t\tswitch (property) {\n\t\t\tcase \"width\":\n\t\t\tcase \"height\":\n\t\t\t\tcomputedValue = getWidthHeight(element, property);\n\t\t\t\tbreak;\n\n\t\t\tcase \"top\":\n\t\t\tcase \"left\":\n\t\t\t\tconst topLeft = true;\n\t\t\tcase \"right\":\n\t\t\tcase \"bottom\":\n\t\t\t\tconst position = getPropertyValue(element, \"position\");\n\n\t\t\t\tif (position === \"fixed\" || (topLeft && position === \"absolute\")) {\n\t\t\t\t\t// Note: this has no pixel unit on its returned values,\n\t\t\t\t\t// we re-add it here to conform with\n\t\t\t\t\t// computePropertyValue's behavior.\n\t\t\t\t\tcomputedValue = element.getBoundingClientRect[property] + \"px\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t// Deliberate fallthrough!\n\t\t\tdefault:\n\t\t\t\tcomputedValue = \"0px\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn computedValue ? String(computedValue) : \"\";\n}\n\n/**\n * Get a property value. This will grab via the cache if it exists, then\n * via any normalisations.\n */\nexport function getPropertyValue(element: HTMLorSVGElement, propertyName: string, fn?: VelocityNormalizationsFn, skipCache?: boolean): string {\n\tconst data = Data(element);\n\tlet propertyValue: string;\n\n\tif (NoCacheNormalizations.has(propertyName)) {\n\t\tskipCache = true;\n\t}\n\tif (!skipCache && data && data.cache[propertyName] != null) {\n\t\tpropertyValue = data.cache[propertyName];\n\t} else {\n\t\tfn = fn || getNormalization(element, propertyName);\n\t\tif (fn) {\n\t\t\tpropertyValue = fn(element);\n\t\t\tif (data) {\n\t\t\t\tdata.cache[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\t}\n\tif (Velocity.debug >= 2) {\n\t\tconsole.info(`Get \"${propertyName}\": \"${propertyValue}\"`, element);\n\t}\n\n\treturn propertyValue;\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Tweens\n */\n\n// Typedefs\nimport {\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, Sequence,\n\tVelocityProperty, VelocityPropertyFn, VelocityPropertyValueFn, VelocityResult, VelocityTween,\n} from \"../../velocity.d\";\n\n// Project\nimport {isFunction, isNumber, isString} from \"../types\";\nimport {cloneArray, getValue} from \"../utility\";\nimport Velocity from \"../velocity\";\nimport {camelCase} from \"./camelCase\";\nimport {fixColors} from \"./css/fixColors\";\nimport {getPropertyValue} from \"./css/getPropertyValue\";\nimport {Data} from \"./data\";\nimport {defaults} from \"./defaults\";\nimport {Easings} from \"./easing/easings\";\nimport {getNormalization, getNormalizationUnit} from \"./normalizations/normalizations\";\nimport {validateEasing} from \"./options\";\nimport {State} from \"./state\";\n\n// Constants\nconst rxHex = /^#([A-f\\d]{3}){1,2}$/i,\n\tcommands: {\n\t\t[type: string]: (\n\t\t\tvalue: any,\n\t\t\telement: HTMLorSVGElement,\n\t\t\telements: VelocityResult,\n\t\t\telementArrayIndex: number,\n\t\t\tpropertyName: string,\n\t\t\ttween: VelocityTween) => string;\n\t} = {\n\t\tfunction: (value, element, elements, elementArrayIndex, propertyName, tween) => {\n\t\t\treturn (value as any as VelocityPropertyValueFn).call(element, elementArrayIndex, elements.length, propertyName);\n\t\t},\n\t\tnumber: (value, element, elements, elementArrayIndex, propertyName, tween) => {\n\t\t\treturn String(value) + getNormalizationUnit(tween.fn);\n\t\t},\n\t\tstring: (value, element, elements, elementArrayIndex, propertyName, tween) => {\n\t\t\treturn fixColors(value);\n\t\t},\n\t\tundefined: (value, element, elements, elementArrayIndex, propertyName, tween) => {\n\t\t\treturn fixColors(getPropertyValue(element, propertyName, tween.fn) || \"\");\n\t\t},\n\t};\n\n/**\n * Expand a VelocityProperty argument into a valid sparse Tween array. This\n * pre-allocates the array as it is then the correct size and slightly\n * faster to access.\n */\nexport function expandProperties(animation: AnimationCall, properties: Properties<VelocityProperty>) {\n\tconst tweens = animation.tweens = Object.create(null),\n\t\telements = animation.elements,\n\t\telement = animation.element,\n\t\telementArrayIndex = elements.indexOf(element as any),\n\t\tdata = Data(element),\n\t\tqueue = getValue(animation.queue, animation.options.queue),\n\t\tduration = getValue(animation.options.duration, defaults.duration);\n\n\tfor (const property in properties) {\n\t\tif (properties.hasOwnProperty(property)) {\n\t\t\tconst propertyName = camelCase(property),\n\t\t\t\tfn = getNormalization(element, propertyName);\n\t\t\tlet valueData = properties[property];\n\n\t\t\tif (!fn && propertyName !== \"tween\") {\n\t\t\t\tif (Velocity.debug) {\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to a lack of browser support.`);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (valueData == null) {\n\t\t\t\tif (Velocity.debug) {\n\t\t\t\t\tconsole.log(`Skipping \"${property}\" due to no value supplied.`);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst tween: VelocityTween = tweens[propertyName] = {} as any;\n\t\t\tlet endValue: string,\n\t\t\t\tstartValue: string;\n\n\t\t\ttween.fn = fn;\n\t\t\tif (isFunction(valueData)) {\n\t\t\t\t// If we have a function as the main argument then resolve\n\t\t\t\t// it first, in case it returns an array that needs to be\n\t\t\t\t// split.\n\t\t\t\tvalueData = (valueData as VelocityPropertyFn).call(element, elementArrayIndex, elements.length, elements);\n\t\t\t}\n\t\t\tif (Array.isArray(valueData)) {\n\t\t\t\t// valueData is an array in the form of\n\t\t\t\t// [ endValue, [, easing] [, startValue] ]\n\t\t\t\tconst arr1 = valueData[1],\n\t\t\t\t\tarr2 = valueData[2];\n\n\t\t\t\tendValue = valueData[0] as any;\n\t\t\t\tif ((isString(arr1) && (/^[\\d-]/.test(arr1) || rxHex.test(arr1))) || isFunction(arr1) || isNumber(arr1)) {\n\t\t\t\t\tstartValue = arr1 as any;\n\t\t\t\t} else if ((isString(arr1) && Easings[arr1]) || Array.isArray(arr1)) {\n\t\t\t\t\ttween.easing = validateEasing(arr1, duration);\n\t\t\t\t\tstartValue = arr2 as any;\n\t\t\t\t} else {\n\t\t\t\t\tstartValue = arr1 || arr2 as any;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tendValue = valueData as any;\n\t\t\t}\n\t\t\ttween.end = commands[typeof endValue](endValue, element, elements, elementArrayIndex, propertyName, tween) as any;\n\t\t\tif (startValue != null || (queue === false || data.queueList[queue] === undefined)) {\n\t\t\t\ttween.start = commands[typeof startValue](startValue, element, elements, elementArrayIndex, propertyName, tween) as any;\n\t\t\t\texplodeTween(propertyName, tween, duration);\n\t\t\t}\n\t\t}\n\t}\n}\n\n// TODO: Needs a better match for \"translate3d\" etc - a number must be preceded by some form of break...\nconst rxToken = /((?:[+\\-*/]=)?(?:[+-]?\\d*\\.\\d+|[+-]?\\d+)[a-z%]*|(?:.(?!$|[+-]?\\d|[+\\-*/]=[+-]?\\d))+.|.)/g,\n\trxNumber = /^([+\\-*/]=)?([+-]?\\d*\\.\\d+|[+-]?\\d+)(.*)$/;\n\n/**\n * Find a pattern between multiple strings, return a VelocitySequence with\n * the pattern and the tokenised values.\n *\n * If number then animate.\n * If a string then must match.\n * If units then convert between them by wrapping in a calc().\n * - If already in a calc then nest another layer.\n * If in an rgba() then the first three numbers are rounded.\n */\nexport function findPattern(parts: ReadonlyArray<string>, propertyName: string): Sequence {\n\tconst partsLength = parts.length,\n\t\ttokens: string[][] = [],\n\t\tindexes: number[] = [];\n\tlet numbers: boolean;\n\n\t// First tokenise the strings - these have all values, we will pull\n\t// numbers later.\n\tfor (let part = 0; part < partsLength; part++) {\n\t\tif (isString(parts[part])) {\n\t\t\tif (parts[part] === \"\") {\n\t\t\t\ttokens[part] = [\"\"];\n\t\t\t} else {\n\t\t\t\ttokens[part] = cloneArray(parts[part].match(rxToken));\n\t\t\t}\n\t\t\tindexes[part] = 0;\n\t\t\t// If it matches more than one thing then we've got a number.\n\t\t\tnumbers = numbers || tokens[part].length > 1;\n\t\t\t//console.log(`tokens:`, parts[part], tokens[part])\n\t\t} else {\n\t\t\t// We have an incomplete lineup, it will get tried again later...\n\t\t\treturn;\n\t\t}\n\t}\n\tconst sequence: Sequence = [] as any,\n\t\tpattern = (sequence.pattern = []) as (string | boolean)[],\n\t\taddString = (text: string) => {\n\t\t\tif (isString(pattern[pattern.length - 1])) {\n\t\t\t\tpattern[pattern.length - 1] += text;\n\t\t\t} else if (text) {\n\t\t\t\tpattern.push(text);\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\n\t\t\t\t\t(sequence[part] as any[]).push(null);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\treturnStringType = () => {\n\t\t\tif (numbers || pattern.length > 1) {\n\t\t\t\t//console.error(`Velocity: Trying to pattern match mis-matched strings \"${propertyName}\":`, parts);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst isDisplay = propertyName === \"display\",\n\t\t\t\tisVisibility = propertyName === \"visibility\";\n\n\t\t\tfor (let part = 0; part < partsLength; part++) {\n\t\t\t\tconst value = parts[part];\n\n\t\t\t\tsequence[part][0] = value;\n\t\t\t\t// Don't care about duration...\n\t\t\t\tsequence[part].easing = validateEasing((isDisplay && value === \"none\") || (isVisibility && value === \"hidden\") || (!isDisplay && !isVisibility) ? \"at-end\" : \"at-start\", 400);\n\t\t\t}\n\t\t\tpattern[0] = false;\n\n\t\t\treturn sequence;\n\t\t};\n\tlet more = true;\n\n\tfor (let part = 0; part < partsLength; part++) {\n\t\tsequence[part] = [];\n\t}\n\twhile (more) {\n\t\tconst bits: ([number, string] | [number, string, boolean])[] = [],\n\t\t\tunits: string[] = [];\n\t\tlet text: string,\n\t\t\tisUnitless = false,\n\t\t\thasNumbers = false;\n\n\t\tfor (let part = 0; part < partsLength; part++) {\n\t\t\tconst index = indexes[part]++,\n\t\t\t\ttoken = tokens[part][index];\n\n\t\t\tif (token) {\n\t\t\t\tconst num = token.match(rxNumber); // [ignore, change, number, unit]\n\n\t\t\t\tif (num) {\n\t\t\t\t\t// It's a number, possibly with a += change and unit.\n\t\t\t\t\tif (text) {\n\t\t\t\t\t\treturn returnStringType();\n\t\t\t\t\t}\n\t\t\t\t\tconst digits = parseFloat(num[2]),\n\t\t\t\t\t\tunit = num[3],\n\t\t\t\t\t\tchange = num[1] ? num[1][0] + unit : undefined,\n\t\t\t\t\t\tchangeOrUnit = change || unit;\n\n\t\t\t\t\tif (digits && !units.includes(changeOrUnit)) {\n\t\t\t\t\t\t// Will be an empty string at the least.\n\t\t\t\t\t\tunits.push(changeOrUnit);\n\t\t\t\t\t}\n\t\t\t\t\tif (!unit) {\n\t\t\t\t\t\tif (digits) {\n\t\t\t\t\t\t\thasNumbers = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisUnitless = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbits[part] = change ? [digits, changeOrUnit, true] : [digits, changeOrUnit];\n\t\t\t\t} else if (bits.length) {\n\t\t\t\t\treturn returnStringType();\n\t\t\t\t} else {\n\t\t\t\t\t// It's a string.\n\t\t\t\t\tif (!text) {\n\t\t\t\t\t\ttext = token;\n\t\t\t\t\t} else if (text !== token) {\n\t\t\t\t\t\treturn returnStringType();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (!part) {\n\t\t\t\tfor (; part < partsLength; part++) {\n\t\t\t\t\tconst index2 = indexes[part]++;\n\n\t\t\t\t\tif (tokens[part][index2]) {\n\t\t\t\t\t\treturn returnStringType();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// IMPORTANT: This is the exit point.\n\t\t\t\tmore = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// Different\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (text) {\n\t\t\taddString(text);\n\t\t} else if (units.length) {\n\t\t\tif (units.length === 2 && isUnitless && !hasNumbers) {\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\n\t\t\t\tunits.splice(units[0] ? 1 : 0, 1);\n\t\t\t}\n\t\t\tif (units.length === 1) {\n\t\t\t\t// All the same units, so append number then unit.\n\t\t\t\tconst unit = units[0],\n\t\t\t\t\tfirstLetter = unit[0];\n\n\t\t\t\tswitch (firstLetter) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\tif (propertyName) {\n\t\t\t\t\t\t\tconsole.error(`Velocity: The first property must not contain a relative function \"${propertyName}\":`, parts);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpattern.push(false);\n\t\t\t\tfor (let part = 0; part < partsLength; part++) {\n\t\t\t\t\t(sequence[part] as any[]).push(bits[part][0]);\n\t\t\t\t}\n\t\t\t\taddString(unit);\n\t\t\t} else {\n\t\t\t\t// Multiple units, so must be inside a calc.\n\t\t\t\taddString(\"calc(\");\n\t\t\t\tconst patternCalc = pattern.length - 1; // Store the beginning of our calc.\n\n\t\t\t\tfor (let i = 0; i < units.length; i++) {\n\t\t\t\t\tconst unit = units[i],\n\t\t\t\t\t\tfirstLetter = unit[0],\n\t\t\t\t\t\tisComplex = firstLetter === \"*\" || firstLetter === \"/\",\n\t\t\t\t\t\tisMaths = isComplex || firstLetter === \"+\" || firstLetter === \"-\";\n\n\t\t\t\t\tif (isComplex) {\n\t\t\t\t\t\t// TODO: Not sure this should be done automatically!\n\t\t\t\t\t\tpattern[patternCalc] += \"(\";\n\t\t\t\t\t\taddString(\")\");\n\t\t\t\t\t}\n\t\t\t\t\tif (i) {\n\t\t\t\t\t\taddString(` ${isMaths ? firstLetter : \"+\"} `);\n\t\t\t\t\t}\n\t\t\t\t\tpattern.push(false);\n\t\t\t\t\tfor (let part = 0; part < partsLength; part++) {\n\t\t\t\t\t\tconst bit = bits[part],\n\t\t\t\t\t\t\tvalue = bit[1] === unit\n\t\t\t\t\t\t\t\t? bit[0]\n\t\t\t\t\t\t\t\t: bit.length === 3\n\t\t\t\t\t\t\t\t\t? sequence[part - 1][sequence[part - 1].length - 1]\n\t\t\t\t\t\t\t\t\t: isComplex ? 1 : 0;\n\n\t\t\t\t\t\t(sequence[part] as any[]).push(value);\n\t\t\t\t\t}\n\t\t\t\t\taddString(isMaths ? unit.substring(1) : unit);\n\t\t\t\t}\n\t\t\t\taddString(\")\");\n\t\t\t}\n\t\t}\n\t}\n\t// We've got here, so a valid sequence - now check and fix RGB rounding\n\t// and calc() nesting...\n\t// TODO: Nested calc(a + calc(b + c)) -> calc(a + (b + c))\n\tfor (let i = 0, inRGB = 0; i < pattern.length; i++) {\n\t\tconst text = pattern[i];\n\n\t\tif (isString(text)) {\n\t\t\tif (inRGB && (text as string).indexOf(\",\") >= 0) {\n\t\t\t\tinRGB++;\n\t\t\t} else if ((text as string).indexOf(\"rgb\") >= 0) {\n\t\t\t\tinRGB = 1;\n\t\t\t}\n\t\t} else if (inRGB) {\n\t\t\tif (inRGB < 4) {\n\t\t\t\tpattern[i] = true;\n\t\t\t} else {\n\t\t\t\tinRGB = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn sequence;\n}\n\n/**\n * Convert a string-based tween with start and end strings, into a pattern\n * based tween with arrays.\n */\nfunction explodeTween(propertyName: string, tween: VelocityTween, duration: number, starting?: boolean) {\n\tconst startValue: string = tween.start,\n\t\tendValue: string = tween.end;\n\n\tif (!isString(endValue) || !isString(startValue)) {\n\t\treturn;\n\t}\n\tlet sequence: Sequence = findPattern([startValue, endValue], propertyName);\n\n\tif (!sequence && starting) {\n\t\t// This little piece will take a startValue, split out the\n\t\t// various numbers in it, then copy the endValue into the\n\t\t// startValue while replacing the numbers in it to match the\n\t\t// original start numbers as a repeating sequence.\n\t\t// Finally this function will run again with the new\n\t\t// startValue and a now matching pattern.\n\t\tconst startNumbers = startValue.match(/\\d\\.?\\d*/g) || [\"0\"],\n\t\t\tcount = startNumbers.length;\n\t\tlet index = 0;\n\n\t\tsequence = findPattern([endValue.replace(/\\d+\\.?\\d*/g, () => {\n\t\t\treturn startNumbers[index++ % count];\n\t\t}), endValue], propertyName);\n\t}\n\tif (sequence) {\n\t\tif (Velocity.debug) {\n\t\t\tconsole.log(`Velocity: Sequence found:`, sequence);\n\t\t}\n\t\tsequence[0].percent = 0;\n\t\tsequence[1].percent = 1;\n\t\ttween.sequence = sequence;\n\t\tswitch (tween.easing) {\n\t\t\tcase Easings[\"at-start\"]:\n\t\t\tcase Easings[\"during\"]:\n\t\t\tcase Easings[\"at-end\"]:\n\t\t\t\tsequence[0].easing = sequence[1].easing = tween.easing;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Expand all queued animations that haven't gone yet\n *\n * This will automatically expand the properties map for any recently added\n * animations so that the start and end values are correct.\n */\nexport function validateTweens(activeCall: AnimationCall) {\n\t// This might be called on an already-ready animation\n\tif (State.firstNew === activeCall) {\n\t\tState.firstNew = activeCall._next;\n\t}\n\t// Check if we're actually already ready\n\tif (activeCall._flags & AnimationFlags.EXPANDED) { // tslint:disable-line:no-bitwise\n\t\treturn;\n\t}\n\tconst element = activeCall.element,\n\t\ttweens = activeCall.tweens,\n\t\tduration = getValue(activeCall.options.duration, defaults.duration);\n\n\t// tslint:disable-next-line:forin\n\tfor (const propertyName in tweens) {\n\t\tconst tween = tweens[propertyName];\n\n\t\tif (tween.start == null) {\n\t\t\t// Get the start value as it's not been passed in\n\t\t\tconst startValue = getPropertyValue(activeCall.element, propertyName);\n\n\t\t\tif (isString(startValue)) {\n\t\t\t\ttween.start = fixColors(startValue) as any;\n\t\t\t\texplodeTween(propertyName, tween, duration, true);\n\t\t\t} else if (!Array.isArray(startValue)) {\n\t\t\t\tconsole.warn(`bad type`, tween, propertyName, startValue);\n\t\t\t}\n\t\t}\n\t\tif (Velocity.debug) {\n\t\t\tconsole.log(`tweensContainer \"${propertyName}\": ${JSON.stringify(tween)}`, element);\n\t\t}\n\t}\n\tactiveCall._flags |= AnimationFlags.EXPANDED; // tslint:disable-line:no-bitwise\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Tick\n */\n\n// Typedefs\nimport {AnimationCall, AnimationFlags, TweenStep} from \"../../velocity.d\";\n\n// Project\nimport {now} from \"../utility\";\nimport Velocity from \"../velocity\";\nimport {completeCall} from \"./complete\";\nimport {removeNestedCalc} from \"./css/removeNestedCalc\";\nimport {setPropertyValue} from \"./css/setPropertyValue\";\nimport {Data} from \"./data\";\nimport {defaults} from \"./defaults\";\nimport {linearEasing} from \"./easing/easings\";\nimport {freeAnimationCall} from \"./queue\";\nimport {State} from \"./state\";\nimport {validateTweens} from \"./tweens\";\n\n/**\n * Call the begin method of an animation in a separate function so it can\n * benefit from JIT compiling while still having a try/catch block.\n */\nexport function beginCall(activeCall: AnimationCall) {\n\tconst callback = activeCall.begin || activeCall.options.begin;\n\n\tif (callback) {\n\t\ttry {\n\t\t\tconst elements = activeCall.elements;\n\n\t\t\tcallback.call(elements, elements, activeCall);\n\t\t} catch (error) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthrow error;\n\t\t\t}, 1);\n\t\t}\n\t}\n}\n\n/**\n * Call the progress method of an animation in a separate function so it can\n * benefit from JIT compiling while still having a try/catch block.\n */\nfunction progressCall(activeCall: AnimationCall) {\n\tconst callback = activeCall.progress || activeCall.options.progress;\n\n\tif (callback) {\n\t\ttry {\n\t\t\tconst elements = activeCall.elements,\n\t\t\t\tpercentComplete = activeCall.percentComplete,\n\t\t\t\toptions = activeCall.options,\n\t\t\t\ttweenValue = activeCall.tween;\n\n\t\t\tcallback.call(elements,\n\t\t\t\telements,\n\t\t\t\tpercentComplete,\n\t\t\t\tMath.max(0, activeCall.timeStart + (activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaults.duration) - lastTick),\n\t\t\t\ttweenValue !== undefined ? tweenValue : String(percentComplete * 100),\n\t\t\t\tactiveCall);\n\t\t} catch (error) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthrow error;\n\t\t\t}, 1);\n\t\t}\n\t}\n}\n\n/**\n * Call callbacks, potentially run async with the main animation thread.\n */\nfunction asyncCallbacks() {\n\tfor (const activeCall of progressed) {\n\t\tprogressCall(activeCall);\n\t}\n\tprogressed.clear();\n\tfor (const activeCall of completed) {\n\t\tcompleteCall(activeCall);\n\t}\n\tcompleted.clear();\n}\n\n/**************\n Timing\n **************/\n\nconst FRAME_TIME = 1000 / 60,\n\t/**\n\t * Animations with a Complete callback.\n\t */\n\tcompleted = new Set<AnimationCall>(),\n\t/**\n\t * Animations with a Progress callback.\n\t */\n\tprogressed = new Set<AnimationCall>(),\n\t/**\n\t * Shim for window.performance in case it doesn't exist\n\t */\n\tperformance = (() => {\n\t\tconst perf = window.performance || {} as Performance;\n\n\t\tif (typeof perf.now !== \"function\") {\n\t\t\tconst nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : now();\n\n\t\t\tperf.now = () => {\n\t\t\t\treturn now() - nowOffset;\n\t\t\t};\n\t\t}\n\n\t\treturn perf;\n\t})(),\n\t/**\n\t * Proxy function for when rAF is not available.\n\t *\n\t * This should hopefully never be used as the browsers often throttle\n\t * this to less than one frame per second in the background, making it\n\t * completely unusable.\n\t */\n\trAFProxy = (callback: FrameRequestCallback) => {\n\t\treturn setTimeout(callback, Math.max(0, FRAME_TIME - (performance.now() - lastTick)));\n\t},\n\t/**\n\t * Either requestAnimationFrame, or a shim for it.\n\t */\n\trAFShim = window.requestAnimationFrame || rAFProxy;\n\n/**\n * Set if we are currently inside a tick() to prevent double-calling.\n */\nlet ticking: boolean,\n\t/**\n\t * A background WebWorker that sends us framerate messages when we're in\n\t * the background. Without this we cannot maintain frame accuracy.\n\t */\n\tworker: Worker;\n\n/**\n * The time that the last animation frame ran at. Set from tick(), and used\n * for missing rAF (ie, when not in focus etc).\n */\nexport let lastTick: number = 0;\n\n/**\n * WebWorker background function.\n *\n * When we're in the background this will send us a msg every tick, when in\n * the foreground it won't.\n *\n * When running in the background the browser reduces allowed CPU etc, so\n * we raun at 30fps instead of 60fps.\n */\nfunction workerFn(this: Worker) {\n\tlet interval: any;\n\n\tthis.onmessage = (e) => {\n\t\tswitch (e.data) {\n\t\t\tcase true:\n\t\t\t\tif (!interval) {\n\t\t\t\t\tinterval = setInterval(() => {\n\t\t\t\t\t\tthis.postMessage(true);\n\t\t\t\t\t}, 1000 / 30);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase false:\n\t\t\t\tif (interval) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\tinterval = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthis.postMessage(e.data);\n\t\t\t\tbreak;\n\t\t}\n\t};\n}\n\ntry {\n\t// Create the worker - this might not be supported, hence the try/catch.\n\tworker = new Worker(URL.createObjectURL(new Blob([`(${workerFn})()`])));\n\t// Whenever the worker sends a message we tick()\n\tworker.onmessage = (e: MessageEvent) => {\n\t\tif (e.data === true) {\n\t\t\ttick();\n\t\t} else {\n\t\t\tasyncCallbacks();\n\t\t}\n\t};\n\t// And watch for going to the background to start the WebWorker running.\n\tif (!State.isMobile && document.hidden !== undefined) {\n\t\tdocument.addEventListener(\"visibilitychange\", () => {\n\t\t\tworker.postMessage(State.isTicking && document.hidden);\n\t\t});\n\t}\n} catch (e) {\n\t/*\n\t * WebWorkers are not supported in this format. This can happen in IE10\n\t * where it can't create one from a blob this way. We fallback, but make\n\t * no guarantees towards accuracy in this case.\n\t */\n}\n\n/**\n * Called on every tick, preferably through rAF. This is reponsible for\n * initialising any new animations, then starting any that need starting.\n * Finally it will expand any tweens and set the properties relating to\n * them. If there are any callbacks relating to the animations then they\n * will attempt to call at the end (with the exception of \"begin\").\n */\nexport function tick(timestamp?: number | boolean) {\n\tif (ticking) {\n\t\t// Should never happen - but if we've swapped back from hidden to\n\t\t// visibile then we want to make sure\n\t\treturn;\n\t}\n\tticking = true;\n\t/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\n\t We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\n\t the browser's next tick sync time occurs, which results in the first elements subjected to Velocity\n\t calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore\n\t the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated\n\t by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */\n\tif (timestamp !== false) {\n\t\tconst timeCurrent = performance.now(),\n\t\t\tdeltaTime = lastTick ? timeCurrent - lastTick : FRAME_TIME,\n\t\t\tdefaultSpeed = defaults.speed,\n\t\t\tdefaultEasing = defaults.easing,\n\t\t\tdefaultDuration = defaults.duration;\n\t\tlet activeCall: AnimationCall,\n\t\t\tnextCall: AnimationCall;\n\n\t\tif (deltaTime >= defaults.minFrameTime || !lastTick) {\n\t\t\tlastTick = timeCurrent;\n\n\t\t\t/********************\n\t\t\t Call Iteration\n\t\t\t ********************/\n\n\t\t\t// Expand any tweens that might need it.\n\t\t\twhile (State.firstNew) {\n\t\t\t\tvalidateTweens(State.firstNew);\n\t\t\t}\n\t\t\t// Iterate through each active call.\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = activeCall._next) {\n\t\t\t\tconst element = activeCall.element,\n\t\t\t\t\tdata = Data(element);\n\n\t\t\t\t// Check to see if this element has been deleted midway\n\t\t\t\t// through the animation. If it's gone then end this\n\t\t\t\t// animation.\n\t\t\t\tif (!element.parentNode || !data) {\n\t\t\t\t\t// TODO: Remove safely - decrease count, delete data, remove from arrays\n\t\t\t\t\tfreeAnimationCall(activeCall);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Don't bother getting until we can use these.\n\t\t\t\tconst options = activeCall.options,\n\t\t\t\t\tflags = activeCall._flags;\n\t\t\t\tlet timeStart = activeCall.timeStart;\n\n\t\t\t\t// If this is the first time that this call has been\n\t\t\t\t// processed by tick() then we assign timeStart now so that\n\t\t\t\t// it's value is as close to the real animation start time\n\t\t\t\t// as possible.\n\t\t\t\tif (!timeStart) {\n\t\t\t\t\tconst queue = activeCall.queue != null ? activeCall.queue : options.queue;\n\n\t\t\t\t\ttimeStart = timeCurrent - deltaTime;\n\t\t\t\t\tif (queue !== false) {\n\t\t\t\t\t\ttimeStart = Math.max(timeStart, data.lastFinishList[queue] || 0);\n\t\t\t\t\t}\n\t\t\t\t\tactiveCall.timeStart = timeStart;\n\t\t\t\t}\n\t\t\t\t// If this animation is paused then skip processing unless\n\t\t\t\t// it has been set to resume.\n\t\t\t\tif (flags & AnimationFlags.PAUSED) { // tslint:disable-line:no-bitwise\n\t\t\t\t\t// Update the time start to accomodate the paused\n\t\t\t\t\t// completion amount.\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Check if this animation is ready - if it's synced then it\n\t\t\t\t// needs to wait for all other animations in the sync\n\t\t\t\tif (!(flags & AnimationFlags.READY)) { // tslint:disable-line:no-bitwise\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.READY; // tslint:disable-line:no-bitwise\n\t\t\t\t\toptions._ready++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Need to split the loop, as ready sync animations must all get\n\t\t\t// the same start time.\n\t\t\tfor (activeCall = State.first; activeCall && activeCall !== State.firstNew; activeCall = nextCall) {\n\t\t\t\tconst flags = activeCall._flags;\n\n\t\t\t\tnextCall = activeCall._next;\n\t\t\t\tif (!(flags & AnimationFlags.READY) || (flags & AnimationFlags.PAUSED)) { // tslint:disable-line:no-bitwise\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst options = activeCall.options;\n\n\t\t\t\tif ((flags & AnimationFlags.SYNC) && options._ready < options._total) { // tslint:disable-line:no-bitwise\n\t\t\t\t\tactiveCall.timeStart += deltaTime;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst speed = activeCall.speed != null ? activeCall.speed : options.speed != null ? options.speed : defaultSpeed;\n\t\t\t\tlet timeStart = activeCall.timeStart;\n\n\t\t\t\t// Don't bother getting until we can use these.\n\t\t\t\tif (!(flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\n\t\t\t\t\tconst delay = activeCall.delay != null ? activeCall.delay : options.delay;\n\n\t\t\t\t\t// Make sure anything we've delayed doesn't start\n\t\t\t\t\t// animating yet, there might still be an active delay\n\t\t\t\t\t// after something has been un-paused\n\t\t\t\t\tif (delay) {\n\t\t\t\t\t\tif (timeStart + (delay / speed) > timeCurrent) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tactiveCall.timeStart = timeStart += delay / (delay > 0 ? speed : 1);\n\t\t\t\t\t}\n\t\t\t\t\tactiveCall._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\n\t\t\t\t\t// The begin callback is fired once per call, not once\n\t\t\t\t\t// per element, and is passed the full raw DOM element\n\t\t\t\t\t// set as both its context and its first argument.\n\t\t\t\t\tif (options._started++ === 0) {\n\t\t\t\t\t\toptions._first = activeCall;\n\t\t\t\t\t\tif (options.begin) {\n\t\t\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\n\t\t\t\t\t\t\tbeginCall(activeCall);\n\t\t\t\t\t\t\t// Only called once, even if reversed or repeated\n\t\t\t\t\t\t\toptions.begin = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (speed !== 1) {\n\t\t\t\t\t// On the first frame we may have a shorter delta\n\t\t\t\t\t// const delta = Math.min(deltaTime, timeCurrent - timeStart);\n\t\t\t\t\tactiveCall.timeStart = timeStart += Math.min(deltaTime, timeCurrent - timeStart) * (1 - speed);\n\t\t\t\t}\n\t\t\t\tconst activeEasing = activeCall.easing != null ? activeCall.easing : options.easing != null ? options.easing : defaultEasing,\n\t\t\t\t\tmillisecondsEllapsed = activeCall.ellapsedTime = timeCurrent - timeStart,\n\t\t\t\t\tduration = activeCall.duration != null ? activeCall.duration : options.duration != null ? options.duration : defaultDuration,\n\t\t\t\t\tpercentComplete = activeCall.percentComplete = Velocity.mock ? 1 : Math.min(millisecondsEllapsed / duration, 1),\n\t\t\t\t\ttweens = activeCall.tweens,\n\t\t\t\t\treverse = flags & AnimationFlags.REVERSE; // tslint:disable-line:no-bitwise\n\n\t\t\t\tif (activeCall.progress || (options._first === activeCall && options.progress)) {\n\t\t\t\t\tprogressed.add(activeCall);\n\t\t\t\t}\n\t\t\t\tif (percentComplete === 1) {\n\t\t\t\t\tcompleted.add(activeCall);\n\t\t\t\t}\n\t\t\t\t// tslint:disable-next-line:forin\n\t\t\t\tfor (const property in tweens) {\n\t\t\t\t\t// For every element, iterate through each property.\n\t\t\t\t\tconst tween = tweens[property],\n\t\t\t\t\t\tsequence = tween.sequence,\n\t\t\t\t\t\tpattern = sequence.pattern;\n\t\t\t\t\tlet currentValue = \"\",\n\t\t\t\t\t\ti = 0;\n\n\t\t\t\t\tif (pattern) {\n\t\t\t\t\t\tconst easingComplete = (tween.easing || activeEasing)(percentComplete, 0, 1, property);\n\t\t\t\t\t\tlet best = 0;\n\n\t\t\t\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\n\t\t\t\t\t\t\tif (sequence[j].percent < easingComplete) {\n\t\t\t\t\t\t\t\tbest = j;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst tweenFrom: TweenStep = sequence[best],\n\t\t\t\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\n\t\t\t\t\t\t\trawPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\n\t\t\t\t\t\t\ttweenPercent = reverse ? 1 - rawPercent : rawPercent,\n\t\t\t\t\t\t\teasing = tweenTo.easing || activeEasing || linearEasing;\n\n\t\t\t\t\t\tfor (; i < pattern.length; i++) {\n\t\t\t\t\t\t\tconst startValue = tweenFrom[i];\n\n\t\t\t\t\t\t\tif (startValue == null) {\n\t\t\t\t\t\t\t\tcurrentValue += pattern[i];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst endValue = tweenTo[i];\n\n\t\t\t\t\t\t\t\tif (startValue === endValue) {\n\t\t\t\t\t\t\t\t\tcurrentValue += startValue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\n\t\t\t\t\t\t\t\t\tconst result = easing(tweenPercent, startValue as number, endValue as number, property);\n\n\t\t\t\t\t\t\t\t\tcurrentValue += pattern[i] !== true ? result : Math.round(result);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (property !== \"tween\") {\n\t\t\t\t\t\t\tif (percentComplete === 1) {\n\t\t\t\t\t\t\t\tcurrentValue = removeNestedCalc(currentValue);\n\t\t\t\t\t\t\t}\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\n\t\t\t\t\t\t\tsetPropertyValue(activeCall.element, property, currentValue, tween.fn);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Skip the fake 'tween' property as that is only\n\t\t\t\t\t\t\t// passed into the progress callback.\n\t\t\t\t\t\t\tactiveCall.tween = currentValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Missing pattern:`, property, JSON.stringify(tween[property]));\n\t\t\t\t\t\tdelete tweens[property];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (progressed.size || completed.size) {\n\t\t\t\tif (!document.hidden) {\n\t\t\t\t\tasyncCallbacks();\n\t\t\t\t} else if (worker) {\n\t\t\t\t\tworker.postMessage(\"\");\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(asyncCallbacks, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (State.first) {\n\t\tState.isTicking = true;\n\t\tif (!document.hidden) {\n\t\t\trAFShim(tick);\n\t\t} else if (!worker) {\n\t\t\trAFProxy(tick);\n\t\t} else if (timestamp === false) {\n\t\t\t// Make sure we turn on the messages.\n\t\t\tworker.postMessage(true);\n\t\t}\n\t} else {\n\t\tState.isTicking = false;\n\t\tlastTick = 0;\n\t\tif (document.hidden && worker) {\n\t\t\t// Make sure we turn off the messages.\n\t\t\tworker.postMessage(false);\n\t\t}\n\t}\n\tticking = false;\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Finish all animation.\n */\n\n// Typedefs\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\n\n// Project\nimport {isVelocityResult} from \"../../types\";\nimport {getValue} from \"../../utility\";\nimport {completeCall} from \"../complete\";\nimport {setPropertyValue} from \"../css/setPropertyValue\";\nimport {defaults} from \"../defaults\";\nimport {validateQueue} from \"../options\";\nimport {State} from \"../state\";\nimport {beginCall} from \"../tick\";\nimport {validateTweens} from \"../tweens\";\nimport {registerAction} from \"./actions\";\n\n/**\n * Check if an animation should be finished, and if so we set the tweens to\n * the final value for it, then call complete.\n */\nfunction checkAnimationShouldBeFinished(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\n\tvalidateTweens(animation);\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\n\t\tif (!(animation._flags & AnimationFlags.STARTED)) { // tslint:disable-line:no-bitwise\n\t\t\t// Copied from tick.ts - ensure that the animation is completely\n\t\t\t// valid and run begin() before complete().\n\t\t\tconst options = animation.options;\n\n\t\t\t// The begin callback is fired once per call, not once per\n\t\t\t// element, and is passed the full raw DOM element set as both\n\t\t\t// its context and its first argument.\n\t\t\tif (options._started++ === 0) {\n\t\t\t\toptions._first = animation;\n\t\t\t\tif (options.begin) {\n\t\t\t\t\t// Pass to an external fn with a try/catch block for optimisation\n\t\t\t\t\tbeginCall(animation);\n\t\t\t\t\t// Only called once, even if reversed or repeated\n\t\t\t\t\toptions.begin = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\tanimation._flags |= AnimationFlags.STARTED; // tslint:disable-line:no-bitwise\n\t\t}\n\t\t// tslint:disable-next-line:forin\n\t\tfor (const property in animation.tweens) {\n\t\t\tconst tween = animation.tweens[property],\n\t\t\t\tsequence = tween.sequence,\n\t\t\t\tpattern = sequence.pattern;\n\t\t\tlet currentValue = \"\",\n\t\t\t\ti = 0;\n\n\t\t\tif (pattern) {\n\t\t\t\tconst endValues = sequence[sequence.length - 1];\n\n\t\t\t\tfor (; i < pattern.length; i++) {\n\t\t\t\t\tconst endValue = endValues[i];\n\n\t\t\t\t\tcurrentValue += endValue == null ? pattern[i] : endValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetPropertyValue(animation.element, property, currentValue, tween.fn);\n\t\t}\n\t\tcompleteCall(animation);\n\t}\n}\n\n/**\n * When the finish action is triggered, the elements' currently active call is\n * immediately finished. When an element is finished, the next item in its\n * animation queue is immediately triggered. If passed via a chained call\n * then this will only target the animations in that call, and not the\n * elements linked to it.\n *\n * A queue name may be passed in to specify that only animations on the\n * named queue are finished. The default queue is named \"\". In addition the\n * value of `false` is allowed for the queue name.\n *\n * An final argument may be passed in to clear an element's remaining queued\n * calls. This may only be the value `true`.\n */\nfunction finish(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise): void {\n\tconst queueName: string | false = validateQueue(args[0], true),\n\t\tdefaultQueue: false | string = defaults.queue,\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\n\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\n\t\tfor (const animation of elements.velocity.animations) {\n\t\t\tcheckAnimationShouldBeFinished(animation, queueName, defaultQueue);\n\t\t}\n\t} else {\n\t\twhile (State.firstNew) {\n\t\t\tvalidateTweens(State.firstNew);\n\t\t}\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\n\t\t\tnextCall = activeCall._next;\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\n\t\t\t\tcheckAnimationShouldBeFinished(activeCall, queueName, defaultQueue);\n\t\t\t}\n\t\t}\n\t}\n\tif (promiseHandler) {\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\n\t\t\telements.then(promiseHandler._resolver);\n\t\t} else {\n\t\t\tpromiseHandler._resolver(elements);\n\t\t}\n\t}\n}\n\nregisterAction([\"finish\", finish], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Get or set a value from one or more running animations.\n */\n\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\n\nimport {isVelocityResult} from \"../../types\";\nimport {getValue} from \"../../utility\";\nimport {defaults} from \"../defaults\";\nimport {\n\tvalidateBegin, validateCache, validateComplete, validateDelay, validateDuration,\n\tvalidateFpsLimit, validateLoop, validateQueue, validateRepeat,\n} from \"../options\";\nimport {State} from \"../state\";\nimport {lastTick} from \"../tick\";\nimport {registerAction} from \"./actions\";\n\n/**\n * Used to map getters for the various AnimationFlags.\n */\nconst animationFlags: {[key: string]: number} = {\n\tisExpanded: AnimationFlags.EXPANDED,\n\tisReady: AnimationFlags.READY,\n\tisStarted: AnimationFlags.STARTED,\n\tisStopped: AnimationFlags.STOPPED,\n\tisPaused: AnimationFlags.PAUSED,\n\tisSync: AnimationFlags.SYNC,\n\tisReverse: AnimationFlags.REVERSE,\n};\n\n/**\n * Get or set an option or running AnimationCall data value. If there is no\n * value passed then it will get, otherwise we will set.\n *\n * NOTE: When using \"get\" this will not touch the Promise as it is never\n * returned to the user.\n */\nfunction option(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\n\tconst key = args[0],\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\n\t\tqueueName = queue === \"false\" ? false : validateQueue(queue, true);\n\tlet animations: AnimationCall[],\n\t\tvalue = args[1];\n\n\tif (!key) {\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant key!`);\n\n\t\treturn null;\n\t}\n\t// If we're chaining the return value from Velocity then we are only\n\t// interested in the values related to that call\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\n\t\tanimations = elements.velocity.animations;\n\t} else {\n\t\tanimations = [];\n\n\t\tfor (let activeCall = State.first; activeCall; activeCall = activeCall._next) {\n\t\t\tif (elements.indexOf(activeCall.element) >= 0 && getValue(activeCall.queue, activeCall.options.queue) === queueName) {\n\t\t\t\tanimations.push(activeCall);\n\t\t\t}\n\t\t}\n\t\t// If we're dealing with multiple elements that are pointing at a\n\t\t// single running animation, then instead treat them as a single\n\t\t// animation.\n\t\tif (elements.length > 1 && animations.length > 1) {\n\t\t\tlet i = 1,\n\t\t\t\toptions = animations[0].options;\n\n\t\t\twhile (i < animations.length) {\n\t\t\t\tif (animations[i++].options !== options) {\n\t\t\t\t\toptions = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\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\n\t\t\tif (options) {\n\t\t\t\tanimations = [animations[0]];\n\t\t\t}\n\t\t}\n\t}\n\t// GET\n\tif (value === undefined) {\n\t\tconst result = [],\n\t\t\tflag = animationFlags[key];\n\n\t\tfor (const animation of animations) {\n\t\t\tif (flag === undefined) {\n\t\t\t\t// A normal key to get.\n\t\t\t\tresult.push(getValue(animation[key], animation.options[key]));\n\t\t\t} else {\n\t\t\t\t// A flag that we're checking against.\n\t\t\t\tresult.push((animation._flags & flag) === 0); // tslint:disable-line:no-bitwise\n\t\t\t}\n\t\t}\n\t\tif (elements.length === 1 && animations.length === 1) {\n\t\t\t// If only a single animation is found and we're only targetting a\n\t\t\t// single element, then return the value directly\n\t\t\treturn result[0];\n\t\t}\n\n\t\treturn result;\n\t}\n\t// SET\n\tlet isPercentComplete: boolean;\n\n\tswitch (key) {\n\t\tcase \"cache\":\n\t\t\tvalue = validateCache(value);\n\t\t\tbreak;\n\t\tcase \"begin\":\n\t\t\tvalue = validateBegin(value);\n\t\t\tbreak;\n\t\tcase \"complete\":\n\t\t\tvalue = validateComplete(value);\n\t\t\tbreak;\n\t\tcase \"delay\":\n\t\t\tvalue = validateDelay(value);\n\t\t\tbreak;\n\t\tcase \"duration\":\n\t\t\tvalue = validateDuration(value);\n\t\t\tbreak;\n\t\tcase \"fpsLimit\":\n\t\t\tvalue = validateFpsLimit(value);\n\t\t\tbreak;\n\t\tcase \"loop\":\n\t\t\tvalue = validateLoop(value);\n\t\t\tbreak;\n\t\tcase \"percentComplete\":\n\t\t\tisPercentComplete = true;\n\t\t\tvalue = parseFloat(value);\n\t\t\tbreak;\n\t\tcase \"repeat\":\n\t\tcase \"repeatAgain\":\n\t\t\tvalue = validateRepeat(value);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (key[0] !== \"_\") {\n\t\t\t\tconst num = parseFloat(value);\n\n\t\t\t\tif (value === String(num)) {\n\t\t\t\t\tvalue = num;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t// deliberate fallthrough\n\t\tcase \"queue\":\n\t\tcase \"promise\":\n\t\tcase \"promiseRejectEmpty\":\n\t\tcase \"easing\":\n\t\tcase \"started\":\n\t\t\tconsole.warn(`VelocityJS: Trying to set a read-only key:`, key);\n\n\t\t\treturn;\n\t}\n\tif (value === undefined || value !== value) {\n\t\tconsole.warn(`VelocityJS: Trying to set an invalid value:${key}=${value} (${args[1]})`);\n\n\t\treturn null;\n\t}\n\tfor (const animation of animations) {\n\t\tif (isPercentComplete) {\n\t\t\tanimation.timeStart = lastTick - (getValue(animation.duration, animation.options.duration, defaults.duration) * value);\n\t\t} else {\n\t\t\tanimation[key] = value;\n\t\t}\n\t}\n\tif (promiseHandler) {\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\n\t\t\telements.then(promiseHandler._resolver);\n\t\t} else {\n\t\t\tpromiseHandler._resolver(elements);\n\t\t}\n\t}\n}\n\nregisterAction([\"option\", option], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Pause and resume animation.\n */\n\n// Typedefs\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\n\n// Project\nimport {isVelocityResult} from \"../../types\";\nimport {getValue} from \"../../utility\";\nimport {defaults} from \"../defaults\";\nimport {validateQueue} from \"../options\";\nimport {State} from \"../state\";\nimport {registerAction} from \"./actions\";\n\n/**\n * Check if an animation should be paused / resumed.\n */\nfunction checkAnimation(animation: AnimationCall, queueName: false | string, defaultQueue: false | string, isPaused: boolean) {\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\n\t\tif (isPaused) {\n\t\t\tanimation._flags |= AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\n\t\t} else {\n\t\t\tanimation._flags &= ~AnimationFlags.PAUSED; // tslint:disable-line:no-bitwise\n\t\t}\n\t}\n}\n\n/**\n * Pause and Resume are call-wide (not on a per element basis). Thus, calling pause or resume on a\n * single element will cause any calls that contain tweens for that element to be paused/resumed\n * as well.\n */\nfunction pauseResume(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string) {\n\tconst isPaused = action.indexOf(\"pause\") === 0,\n\t\tqueue = action.indexOf(\".\") >= 0 ? action.replace(/^.*\\./, \"\") : undefined,\n\t\tqueueName = queue === \"false\" ? false : validateQueue(args[0]),\n\t\tdefaultQueue = defaults.queue;\n\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\n\t\tfor (const animation of elements.velocity.animations) {\n\t\t\tcheckAnimation(animation, queueName, defaultQueue, isPaused);\n\t\t}\n\t} else {\n\t\tlet activeCall: AnimationCall = State.first;\n\n\t\twhile (activeCall) {\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\n\t\t\t\tcheckAnimation(activeCall, queueName, defaultQueue, isPaused);\n\t\t\t}\n\t\t\tactiveCall = activeCall._next;\n\t\t}\n\t}\n\tif (promiseHandler) {\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\n\t\t\telements.then(promiseHandler._resolver);\n\t\t} else {\n\t\t\tpromiseHandler._resolver(elements);\n\t\t}\n\t}\n}\n\nregisterAction([\"pause\", pauseResume], true);\nregisterAction([\"resume\", pauseResume], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Get or set a property from one or more elements.\n */\n\n// Typedefs\nimport {VelocityPromise, VelocityResult} from \"../../../velocity.d\";\n\n// Project\nimport {isNumber, isPlainObject, isString, isVelocityResult} from \"../../types\";\nimport {fixColors} from \"../css/fixColors\";\nimport {getPropertyValue} from \"../css/getPropertyValue\";\nimport {setPropertyValue} from \"../css/setPropertyValue\";\nimport {registerAction} from \"./actions\";\n\n/**\n * Get or set a style of Nomralised property value on one or more elements.\n * If there is no value passed then it will get, otherwise we will set.\n *\n * NOTE: When using \"get\" this will not touch the Promise as it is never\n * returned to the user.\n *\n * This can fail to set, and will reject the Promise if it does so.\n *\n * Velocity(elements, \"style\", \"property\", \"value\") => elements;\n * Velocity(elements, \"style\", {\"property\": \"value\", ...}) => elements;\n * Velocity(element, \"style\", \"property\") => \"value\";\n * Velocity(elements, \"style\", \"property\") => [\"value\", ...];\n */\nexport function propertyAction(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\n\tconst property = args[0],\n\t\tvalue = args[1];\n\n\tif (!property) {\n\t\tconsole.warn(`VelocityJS: Cannot access a non-existant property!`);\n\n\t\treturn null;\n\t}\n\t// GET\n\tif (value === undefined && !isPlainObject(property)) {\n\t\tif (Array.isArray(property)) {\n\t\t\tif (elements.length === 1) {\n\t\t\t\tconst result = {};\n\n\t\t\t\tfor (const prop of property) {\n\t\t\t\t\tresult[prop] = fixColors(getPropertyValue(elements[0], prop));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tconst result = [];\n\n\t\t\t\tfor (const element of elements) {\n\t\t\t\t\tconst res = {};\n\n\t\t\t\t\tfor (const prop of property) {\n\t\t\t\t\t\tres[prop] = fixColors(getPropertyValue(element, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\tresult.push(res);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else {\n\t\t\t// If only a single animation is found and we're only targetting a\n\t\t\t// single element, then return the value directly\n\t\t\tif (elements.length === 1) {\n\t\t\t\treturn fixColors(getPropertyValue(elements[0], property));\n\t\t\t}\n\t\t\tconst result = [];\n\n\t\t\tfor (const element of elements) {\n\t\t\t\tresult.push(fixColors(getPropertyValue(element, property)));\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t}\n\t// SET\n\tconst error: string[] = [];\n\n\tif (isPlainObject(property)) {\n\t\tfor (const propertyName in property) {\n\t\t\tif (property.hasOwnProperty(propertyName)) {\n\t\t\t\tfor (const element of elements) {\n\t\t\t\t\tconst propertyValue = property[propertyName];\n\n\t\t\t\t\tif (isString(propertyValue) || isNumber(propertyValue)) {\n\t\t\t\t\t\tsetPropertyValue(element, propertyName, property[propertyName]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror.push(`Cannot set a property \"${propertyName}\" to an unknown type: ${typeof propertyValue}`);\n\t\t\t\t\t\tconsole.warn(`VelocityJS: Cannot set a property \"${propertyName}\" to an unknown type:`, propertyValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (isString(value) || isNumber(value)) {\n\t\tfor (const element of elements) {\n\t\t\tsetPropertyValue(element, property, String(value));\n\t\t}\n\t} else {\n\t\terror.push(`Cannot set a property \"${property}\" to an unknown type: ${typeof value}`);\n\t\tconsole.warn(`VelocityJS: Cannot set a property \"${property}\" to an unknown type:`, value);\n\t}\n\tif (promiseHandler) {\n\t\tif (error.length) {\n\t\t\tpromiseHandler._rejecter(error.join(\", \"));\n\t\t} else if (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\n\t\t\telements.then(promiseHandler._resolver);\n\t\t} else {\n\t\t\tpromiseHandler._resolver(elements);\n\t\t}\n\t}\n}\n\nregisterAction([\"property\", propertyAction], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Actions that can be performed by passing a string instead of a propertiesMap.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\n\n// Project\nimport {registerAction} from \"./actions\";\n\nregisterAction([\"reverse\", (args?: any[], elements?: HTMLorSVGElement[] | VelocityResult, promiseHandler?: VelocityPromise, action?: string) => {\n\t// NOTE: Code needs to split out before here - but this is needed to prevent it being overridden\n\tthrow new SyntaxError(\"VelocityJS: The 'reverse' action is built in and private.\");\n}], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Stop animation.\n */\n\n// Typedefs\nimport {AnimationCall, AnimationFlags, VelocityPromise, VelocityResult} from \"../../../velocity.d\";\n\n// Project\nimport {isVelocityResult} from \"../../types\";\nimport {getValue} from \"../../utility\";\nimport {completeCall} from \"../complete\";\nimport {defaults} from \"../defaults\";\nimport {validateQueue} from \"../options\";\nimport {State} from \"../state\";\nimport {validateTweens} from \"../tweens\";\nimport {registerAction} from \"./actions\";\n\n/**\n * Check if an animation should be stopped, and if so then set the STOPPED\n * flag on it, then call complete.\n */\nfunction checkAnimationShouldBeStopped(animation: AnimationCall, queueName: false | string, defaultQueue: false | string) {\n\tvalidateTweens(animation);\n\tif (queueName === undefined || queueName === getValue(animation.queue, animation.options.queue, defaultQueue)) {\n\t\tanimation._flags |= AnimationFlags.STOPPED; // tslint:disable-line:no-bitwise\n\t\tcompleteCall(animation);\n\t}\n}\n\n/**\n * When the stop action is triggered, the elements' currently active call is\n * immediately stopped. When an element is stopped, the next item in its\n * animation queue is immediately triggered. If passed via a chained call\n * then this will only target the animations in that call, and not the\n * elements linked to it.\n *\n * A queue name may be passed in to specify that only animations on the\n * named queue are stopped. The default queue is named \"\". In addition the\n * value of `false` is allowed for the queue name.\n *\n * An final argument may be passed in to clear an element's remaining queued\n * calls. This may only be the value `true`.\n *\n * Note: The stop command runs prior to Velocity's Queueing phase since its\n * behavior is intended to take effect *immediately*, regardless of the\n * element's current queue state.\n */\nfunction stop(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise, action?: string): void {\n\tconst queueName: string | false = validateQueue(args[0], true),\n\t\tdefaultQueue: false | string = defaults.queue,\n\t\tfinishAll = args[queueName === undefined ? 0 : 1] === true;\n\n\tif (isVelocityResult(elements) && elements.velocity.animations) {\n\t\tfor (const animation of elements.velocity.animations) {\n\t\t\tcheckAnimationShouldBeStopped(animation, queueName, defaultQueue);\n\t\t}\n\t} else {\n\t\twhile (State.firstNew) {\n\t\t\tvalidateTweens(State.firstNew);\n\t\t}\n\t\tfor (let activeCall = State.first, nextCall: AnimationCall; activeCall && (finishAll || activeCall !== State.firstNew); activeCall = nextCall || State.firstNew) {\n\t\t\tnextCall = activeCall._next;\n\t\t\tif (!elements || elements.includes(activeCall.element)) {\n\t\t\t\tcheckAnimationShouldBeStopped(activeCall, queueName, defaultQueue);\n\t\t\t}\n\t\t}\n\t}\n\tif (promiseHandler) {\n\t\tif (isVelocityResult(elements) && elements.velocity.animations && elements.then) {\n\t\t\telements.then(promiseHandler._resolver);\n\t\t} else {\n\t\t\tpromiseHandler._resolver(elements);\n\t\t}\n\t}\n}\n\nregisterAction([\"stop\", stop], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Get or set a property from one or more elements.\n */\n\n// Project\nimport {registerAction} from \"./actions\";\nimport {propertyAction} from \"./property\";\n\nregisterAction([\"style\", propertyAction], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Get or set a property from one or more elements.\n */\n\n// Typedefs\nimport {\n\tAnimationCall, HTMLorSVGElement, Properties, Sequence, SequenceList,\n\tTweenStep, VelocityEasingType, VelocityPromise, VelocityProperty, VelocityResult,\n} from \"../../../velocity.d\";\n\n// Project\nimport {isNumber, isPlainObject, isString} from \"../../types\";\nimport {getValue} from \"../../utility\";\nimport {defaults} from \"../defaults\";\nimport {linearEasing} from \"../easing/easings\";\nimport {validateEasing} from \"../options\";\nimport {expandSequence} from \"../sequences\";\nimport {SequencesObject} from \"../sequencesObject\";\nimport {expandProperties} from \"../tweens\";\nimport {registerAction} from \"./actions\";\n\n// Constants\nimport {DEFAULT_DURATION} from \"../../constants\";\n\n/**\n *\n */\nfunction tweenAction(args?: any[], elements?: VelocityResult, promiseHandler?: VelocityPromise, action?: string): any {\n\tlet requireForcefeeding: boolean;\n\n\tif (!elements) {\n\t\tif (!args.length) {\n\t\t\tconsole.info(`Velocity(<element>, \\\"tween\\\", percentComplete, property, end | [end, <easing>, <start>], <easing>) => value\nVelocity(<element>, \\\"tween\\\", percentComplete, {property: end | [end, <easing>, <start>], ...}, <easing>) => {property: value, ...}`);\n\n\t\t\treturn null;\n\t\t}\n\t\telements = [document.body];\n\t\trequireForcefeeding = true;\n\t} else if (elements.length !== 1) {\n\t\t// TODO: Allow more than a single element to return an array of results\n\t\tthrow new Error(\"VelocityJS: Cannot tween more than one element!\");\n\t}\n\tconst percentComplete: number = args[0],\n\t\tfakeAnimation = {\n\t\t\telements,\n\t\t\telement: elements[0],\n\t\t\tqueue: false,\n\t\t\toptions: {\n\t\t\t\tduration: 1000,\n\t\t\t},\n\t\t\ttweens: null as {[property: string]: Sequence},\n\t\t} as any as AnimationCall,\n\t\tresult: {[property: string]: string} = {};\n\tlet properties: Properties<string> = args[1],\n\t\tsingleResult: boolean,\n\t\tmaybeSequence: SequenceList,\n\t\teasing: VelocityEasingType = args[2],\n\t\tcount = 0;\n\n\tif (isString(args[1])) {\n\t\tif (SequencesObject && SequencesObject[args[1]]) {\n\t\t\tmaybeSequence = SequencesObject[args[1]];\n\t\t\tproperties = {};\n\t\t\teasing = args[2];\n\t\t} else {\n\t\t\tsingleResult = true;\n\t\t\tproperties = {\n\t\t\t\t[args[1]]: args[2],\n\t\t\t};\n\t\t\teasing = args[3];\n\t\t}\n\t} else if (Array.isArray(args[1])) {\n\t\tsingleResult = true;\n\t\tproperties = {\n\t\t\ttween: args[1],\n\t\t} as any;\n\t\teasing = args[2];\n\t}\n\tif (!isNumber(percentComplete) || percentComplete < 0 || percentComplete > 1) {\n\t\tthrow new Error(\"VelocityJS: Must tween a percentage from 0 to 1!\");\n\t}\n\tif (!isPlainObject(properties)) {\n\t\tthrow new Error(\"VelocityJS: Cannot tween an invalid property!\");\n\t}\n\tif (requireForcefeeding) {\n\t\tfor (const property in properties) {\n\t\t\tif (properties.hasOwnProperty(property) && (!Array.isArray(properties[property]) || properties[property].length < 2)) {\n\t\t\t\tthrow new Error(\"VelocityJS: When not supplying an element you must force-feed values: \" + property);\n\t\t\t}\n\t\t}\n\t}\n\tconst activeEasing = validateEasing(getValue(easing, defaults.easing), DEFAULT_DURATION);\n\n\tif (maybeSequence) {\n\t\texpandSequence(fakeAnimation, maybeSequence);\n\t} else {\n\t\texpandProperties(fakeAnimation as AnimationCall, properties);\n\t}\n\t// tslint:disable-next-line:forin\n\tfor (const property in fakeAnimation.tweens) {\n\t\t// For every element, iterate through each property.\n\t\tconst propertyTween = fakeAnimation.tweens[property],\n\t\t\tsequence = propertyTween.sequence,\n\t\t\tpattern = sequence.pattern;\n\t\tlet currentValue = \"\",\n\t\t\ti = 0;\n\n\t\tcount++;\n\t\tif (pattern) {\n\t\t\tconst easingComplete = (propertyTween.easing || activeEasing)(percentComplete, 0, 1, property);\n\t\t\tlet best = 0;\n\n\t\t\tfor (let j = 0; j < sequence.length - 1; j++) {\n\t\t\t\tif (sequence[j].percent < easingComplete) {\n\t\t\t\t\tbest = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst tweenFrom: TweenStep = sequence[best],\n\t\t\t\ttweenTo: TweenStep = sequence[best + 1] || tweenFrom,\n\t\t\t\ttweenPercent = (percentComplete - tweenFrom.percent) / (tweenTo.percent - tweenFrom.percent),\n\t\t\t\ttweenEasing = tweenTo.easing || linearEasing;\n\n\t\t\tfor (; i < pattern.length; i++) {\n\t\t\t\tconst startValue = tweenFrom[i];\n\n\t\t\t\tif (startValue == null) {\n\t\t\t\t\tcurrentValue += pattern[i];\n\t\t\t\t} else {\n\t\t\t\t\tconst endValue = tweenTo[i];\n\n\t\t\t\t\tif (startValue === endValue) {\n\t\t\t\t\t\tcurrentValue += startValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// All easings must deal with numbers except for our internal ones.\n\t\t\t\t\t\tconst value = tweenEasing(tweenPercent, startValue as number, endValue as number, property);\n\n\t\t\t\t\t\tcurrentValue += pattern[i] === true ? Math.round(value) : value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult[property] = currentValue;\n\t\t}\n\t}\n\n\tif (singleResult && count === 1) {\n\t\tfor (const property in result) {\n\t\t\tif (result.hasOwnProperty(property)) {\n\t\t\t\treturn result[property];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nregisterAction([\"tween\", tweenAction], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Project\nimport {ColorNames} from \"./fixColors\";\n\n/**\n * Converting from hex as it makes for a smaller file.\n */\nconst colorValues = {\n\taliceblue: 0xF0F8FF,\n\tantiquewhite: 0xFAEBD7,\n\taqua: 0x00FFFF,\n\taquamarine: 0x7FFFD4,\n\tazure: 0xF0FFFF,\n\tbeige: 0xF5F5DC,\n\tbisque: 0xFFE4C4,\n\tblack: 0x000000,\n\tblanchedalmond: 0xFFEBCD,\n\tblue: 0x0000FF,\n\tblueviolet: 0x8A2BE2,\n\tbrown: 0xA52A2A,\n\tburlywood: 0xDEB887,\n\tcadetblue: 0x5F9EA0,\n\tchartreuse: 0x7FFF00,\n\tchocolate: 0xD2691E,\n\tcoral: 0xFF7F50,\n\tcornflowerblue: 0x6495ED,\n\tcornsilk: 0xFFF8DC,\n\tcrimson: 0xDC143C,\n\tcyan: 0x00FFFF,\n\tdarkblue: 0x00008B,\n\tdarkcyan: 0x008B8B,\n\tdarkgoldenrod: 0xB8860B,\n\tdarkgray: 0xA9A9A9,\n\tdarkgrey: 0xA9A9A9,\n\tdarkgreen: 0x006400,\n\tdarkkhaki: 0xBDB76B,\n\tdarkmagenta: 0x8B008B,\n\tdarkolivegreen: 0x556B2F,\n\tdarkorange: 0xFF8C00,\n\tdarkorchid: 0x9932CC,\n\tdarkred: 0x8B0000,\n\tdarksalmon: 0xE9967A,\n\tdarkseagreen: 0x8FBC8F,\n\tdarkslateblue: 0x483D8B,\n\tdarkslategray: 0x2F4F4F,\n\tdarkslategrey: 0x2F4F4F,\n\tdarkturquoise: 0x00CED1,\n\tdarkviolet: 0x9400D3,\n\tdeeppink: 0xFF1493,\n\tdeepskyblue: 0x00BFFF,\n\tdimgray: 0x696969,\n\tdimgrey: 0x696969,\n\tdodgerblue: 0x1E90FF,\n\tfirebrick: 0xB22222,\n\tfloralwhite: 0xFFFAF0,\n\tforestgreen: 0x228B22,\n\tfuchsia: 0xFF00FF,\n\tgainsboro: 0xDCDCDC,\n\tghostwhite: 0xF8F8FF,\n\tgold: 0xFFD700,\n\tgoldenrod: 0xDAA520,\n\tgray: 0x808080,\n\tgrey: 0x808080,\n\tgreen: 0x008000,\n\tgreenyellow: 0xADFF2F,\n\thoneydew: 0xF0FFF0,\n\thotpink: 0xFF69B4,\n\tindianred: 0xCD5C5C,\n\tindigo: 0x4B0082,\n\tivory: 0xFFFFF0,\n\tkhaki: 0xF0E68C,\n\tlavender: 0xE6E6FA,\n\tlavenderblush: 0xFFF0F5,\n\tlawngreen: 0x7CFC00,\n\tlemonchiffon: 0xFFFACD,\n\tlightblue: 0xADD8E6,\n\tlightcoral: 0xF08080,\n\tlightcyan: 0xE0FFFF,\n\tlightgoldenrodyellow: 0xFAFAD2,\n\tlightgray: 0xD3D3D3,\n\tlightgrey: 0xD3D3D3,\n\tlightgreen: 0x90EE90,\n\tlightpink: 0xFFB6C1,\n\tlightsalmon: 0xFFA07A,\n\tlightseagreen: 0x20B2AA,\n\tlightskyblue: 0x87CEFA,\n\tlightslategray: 0x778899,\n\tlightslategrey: 0x778899,\n\tlightsteelblue: 0xB0C4DE,\n\tlightyellow: 0xFFFFE0,\n\tlime: 0x00FF00,\n\tlimegreen: 0x32CD32,\n\tlinen: 0xFAF0E6,\n\tmagenta: 0xFF00FF,\n\tmaroon: 0x800000,\n\tmediumaquamarine: 0x66CDAA,\n\tmediumblue: 0x0000CD,\n\tmediumorchid: 0xBA55D3,\n\tmediumpurple: 0x9370DB,\n\tmediumseagreen: 0x3CB371,\n\tmediumslateblue: 0x7B68EE,\n\tmediumspringgreen: 0x00FA9A,\n\tmediumturquoise: 0x48D1CC,\n\tmediumvioletred: 0xC71585,\n\tmidnightblue: 0x191970,\n\tmintcream: 0xF5FFFA,\n\tmistyrose: 0xFFE4E1,\n\tmoccasin: 0xFFE4B5,\n\tnavajowhite: 0xFFDEAD,\n\tnavy: 0x000080,\n\toldlace: 0xFDF5E6,\n\tolive: 0x808000,\n\tolivedrab: 0x6B8E23,\n\torange: 0xFFA500,\n\torangered: 0xFF4500,\n\torchid: 0xDA70D6,\n\tpalegoldenrod: 0xEEE8AA,\n\tpalegreen: 0x98FB98,\n\tpaleturquoise: 0xAFEEEE,\n\tpalevioletred: 0xDB7093,\n\tpapayawhip: 0xFFEFD5,\n\tpeachpuff: 0xFFDAB9,\n\tperu: 0xCD853F,\n\tpink: 0xFFC0CB,\n\tplum: 0xDDA0DD,\n\tpowderblue: 0xB0E0E6,\n\tpurple: 0x800080,\n\trebeccapurple: 0x663399,\n\tred: 0xFF0000,\n\trosybrown: 0xBC8F8F,\n\troyalblue: 0x4169E1,\n\tsaddlebrown: 0x8B4513,\n\tsalmon: 0xFA8072,\n\tsandybrown: 0xF4A460,\n\tseagreen: 0x2E8B57,\n\tseashell: 0xFFF5EE,\n\tsienna: 0xA0522D,\n\tsilver: 0xC0C0C0,\n\tskyblue: 0x87CEEB,\n\tslateblue: 0x6A5ACD,\n\tslategray: 0x708090,\n\tslategrey: 0x708090,\n\tsnow: 0xFFFAFA,\n\tspringgreen: 0x00FF7F,\n\tsteelblue: 0x4682B4,\n\ttan: 0xD2B48C,\n\tteal: 0x008080,\n\tthistle: 0xD8BFD8,\n\ttomato: 0xFF6347,\n\tturquoise: 0x40E0D0,\n\tviolet: 0xEE82EE,\n\twheat: 0xF5DEB3,\n\twhite: 0xFFFFFF,\n\twhitesmoke: 0xF5F5F5,\n\tyellow: 0xFFFF00,\n\tyellowgreen: 0x9ACD32,\n};\n\nfor (const name in colorValues) {\n\tif (colorValues.hasOwnProperty(name)) {\n\t\tconst color = colorValues[name];\n\n\t\tColorNames[name] = `${Math.floor(color / 65536)},${Math.floor(color / 256 % 256)},${(color % 256)}`;\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Back easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\n */\n\n// Project\nimport {registerEasing} from \"./easings\";\n\nexport function registerBackIn(name: string, amount: number) {\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\n\t\treturn Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount) * (endValue - startValue);\n\t}]);\n}\n\nexport function registerBackOut(name: string, amount: number) {\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\n\t\treturn (Math.pow(--percentComplete, 2) * ((amount + 1) * percentComplete + amount) + 1) * (endValue - startValue);\n\t}]);\n}\n\nexport function registerBackInOut(name: string, amount: number) {\n\tamount *= 1.525;\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\t\tpercentComplete *= 2;\n\n\t\treturn (percentComplete < 1\n\t\t\t? (Math.pow(percentComplete, 2) * ((amount + 1) * percentComplete - amount))\n\t\t\t: (Math.pow(percentComplete - 2, 2) * ((amount + 1) * (percentComplete - 2) + amount) + 2)\n\t\t) * 0.5 * (endValue - startValue);\n\t}]);\n}\n\nregisterBackIn(\"easeInBack\", 1.7);\nregisterBackOut(\"easeOutBack\", 1.7);\nregisterBackInOut(\"easeInOutBack\", 1.7);\n\n// TODO: Expose these as actions to register custom easings?\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Bounce easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\n */\n\n// Project\nimport {registerEasing} from \"./easings\";\n\nfunction easeOutBouncePercent(percentComplete: number): number {\n\tif (percentComplete < 1 / 2.75) {\n\t\treturn (7.5625 * percentComplete * percentComplete);\n\t}\n\tif (percentComplete < 2 / 2.75) {\n\t\treturn (7.5625 * (percentComplete -= 1.5 / 2.75) * percentComplete + 0.75);\n\t}\n\tif (percentComplete < 2.5 / 2.75) {\n\t\treturn (7.5625 * (percentComplete -= 2.25 / 2.75) * percentComplete + 0.9375);\n\t}\n\n\treturn (7.5625 * (percentComplete -= 2.625 / 2.75) * percentComplete + 0.984375);\n}\n\nfunction easeInBouncePercent(percentComplete: number): number {\n\treturn 1 - easeOutBouncePercent(1 - percentComplete);\n}\n\nexport function easeInBounce(percentComplete: number, startValue: number, endValue: number): number {\n\tif (percentComplete === 0) {\n\t\treturn startValue;\n\t}\n\tif (percentComplete === 1) {\n\t\treturn endValue;\n\t}\n\n\treturn easeInBouncePercent(percentComplete) * (endValue - startValue);\n}\n\nexport function easeOutBounce(percentComplete: number, startValue: number, endValue: number): number {\n\tif (percentComplete === 0) {\n\t\treturn startValue;\n\t}\n\tif (percentComplete === 1) {\n\t\treturn endValue;\n\t}\n\n\treturn easeOutBouncePercent(percentComplete) * (endValue - startValue);\n}\n\nexport function easeInOutBounce(percentComplete: number, startValue: number, endValue: number): number {\n\tif (percentComplete === 0) {\n\t\treturn startValue;\n\t}\n\tif (percentComplete === 1) {\n\t\treturn endValue;\n\t}\n\n\treturn (percentComplete < 0.5\n\t\t? easeInBouncePercent(percentComplete * 2) * 0.5\n\t\t: easeOutBouncePercent(percentComplete * 2 - 1) * 0.5 + 0.5\n\t) * (endValue - startValue);\n}\n\nregisterEasing([\"easeInBounce\", easeInBounce]);\nregisterEasing([\"easeOutBounce\", easeOutBounce]);\nregisterEasing([\"easeInOutBounce\", easeInOutBounce]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Elastic easings, based on code from https://github.com/yuichiroharai/easeplus-velocity\n */\n\n// Project\nimport {registerEasing} from \"./easings\";\n\n// Constants\nconst PI2 = Math.PI * 2;\n\nexport function registerElasticIn(name: string, amplitude: number, period: number) {\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\n\t\treturn -(amplitude * Math.pow(2, 10 * (percentComplete -= 1)) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period)) * (endValue - startValue);\n\t}]);\n}\n\nexport function registerElasticOut(name: string, amplitude: number, period: number) {\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\n\t\treturn (amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - (period / PI2 * Math.asin(1 / amplitude))) * PI2 / period) + 1) * (endValue - startValue);\n\t}]);\n}\n\nexport function registerElasticInOut(name: string, amplitude: number, period: number) {\n\tregisterEasing([name, (percentComplete: number, startValue: number, endValue: number): number => {\n\t\tif (percentComplete === 0) {\n\t\t\treturn startValue;\n\t\t}\n\t\tif (percentComplete === 1) {\n\t\t\treturn endValue;\n\t\t}\n\t\tconst s = period / PI2 * Math.asin(1 / amplitude);\n\n\t\tpercentComplete = percentComplete * 2 - 1;\n\n\t\treturn (percentComplete < 0\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period))\n\t\t\t: amplitude * Math.pow(2, -10 * percentComplete) * Math.sin((percentComplete - s) * PI2 / period) * 0.5 + 1\n\t\t) * (endValue - startValue);\n\t}]);\n}\n\nregisterElasticIn(\"easeInElastic\", 1, 0.3);\nregisterElasticOut(\"easeOutElastic\", 1, 0.3);\nregisterElasticInOut(\"easeInOutElastic\", 1, 0.3 * 1.5);\n\n// TODO: Expose these as actions to register custom easings?\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Easings to act on strings, either set at the start or at the end depending on\n * need.\n */\n\n// Project\nimport {registerEasing} from \"./easings\";\n\n/**\n * Easing function that sets to the specified value immediately after the\n * animation starts.\n */\nexport function atStart(percentComplete: number, startValue: any, endValue: any): any {\n\treturn percentComplete === 0\n\t\t? startValue\n\t\t: endValue;\n}\n\n/**\n * Easing function that sets to the specified value while the animation is\n * running.\n */\nexport function during(percentComplete: number, startValue: any, endValue: any): any {\n\treturn percentComplete === 0 || percentComplete === 1\n\t\t? startValue\n\t\t: endValue;\n}\n\n/**\n * Easing function that sets to the specified value when the animation ends.\n */\nexport function atEnd(percentComplete: number, startValue: any, endValue: any): any {\n\treturn percentComplete === 1\n\t\t? endValue\n\t\t: startValue;\n}\n\nregisterEasing([\"at-start\", atStart]);\nregisterEasing([\"during\", during]);\nregisterEasing([\"at-end\", atEnd]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\n\n// Project\nimport {augmentDimension} from \"../css/augmentDimension\";\nimport {setPropertyValue} from \"../css/setPropertyValue\";\nimport {registerNormalization} from \"./normalizations\";\n\n/**\n * Get/set the inner/outer dimension.\n */\nfunction getDimension(name: \"width\" | \"height\", wantInner: boolean) {\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\n\t\tif (propertyValue === undefined) {\n\t\t\treturn augmentDimension(element, name, wantInner) + \"px\";\n\t\t}\n\t\tsetPropertyValue(element, name, (parseFloat(propertyValue) - augmentDimension(element, name, wantInner)) + \"px\");\n\t}) as VelocityNormalizationsFn;\n}\n\nregisterNormalization([\"Element\", \"innerWidth\", getDimension(\"width\", true)]);\nregisterNormalization([\"Element\", \"innerHeight\", getDimension(\"height\", true)]);\nregisterNormalization([\"Element\", \"outerWidth\", getDimension(\"width\", false)]);\nregisterNormalization([\"Element\", \"outerHeight\", getDimension(\"height\", false)]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\n\n// Project\nimport {computePropertyValue} from \"../css/getPropertyValue\";\nimport {Data} from \"../data\";\nimport {registerNormalization} from \"./normalizations\";\n\n// Constants\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,\n\tlistItemRx = /^(li)$/i,\n\ttableRowRx = /^(tr)$/i,\n\ttableRx = /^(table)$/i,\n\ttableRowGroupRx = /^(tbody)$/i;\n\n/**\n * Display has an extra value of \"auto\" that works out the correct value\n * based on the type of element.\n */\nfunction display(element: HTMLorSVGElement): string;\nfunction display(element: HTMLorSVGElement, propertyValue: string): void;\nfunction display(element: HTMLorSVGElement, propertyValue?: string): string | void {\n\tconst style = element.style;\n\n\tif (propertyValue === undefined) {\n\t\treturn computePropertyValue(element, \"display\");\n\t}\n\tif (propertyValue === \"auto\") {\n\t\tconst nodeName = element && element.nodeName,\n\t\t\tdata = Data(element);\n\n\t\tif (inlineRx.test(nodeName)) {\n\t\t\tpropertyValue = \"inline\";\n\t\t} else if (listItemRx.test(nodeName)) {\n\t\t\tpropertyValue = \"list-item\";\n\t\t} else if (tableRowRx.test(nodeName)) {\n\t\t\tpropertyValue = \"table-row\";\n\t\t} else if (tableRx.test(nodeName)) {\n\t\t\tpropertyValue = \"table\";\n\t\t} else if (tableRowGroupRx.test(nodeName)) {\n\t\t\tpropertyValue = \"table-row-group\";\n\t\t} else {\n\t\t\t// Default to \"block\" when no match is found.\n\t\t\tpropertyValue = \"block\";\n\t\t}\n\t\t// IMPORTANT: We need to do this as getPropertyValue bypasses the\n\t\t// Normalisation when it exists in the cache.\n\t\tdata.cache[\"display\"] = propertyValue;\n\t}\n\tstyle.display = propertyValue;\n}\n\nregisterNormalization([\"Element\", \"display\", display]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\n\n// Project\nimport {getPropertyValue} from \"../css/getPropertyValue\";\nimport {registerNormalization} from \"./normalizations\";\n\n/**\n * Get the scrollWidth of an element.\n */\nfunction clientWidth(element: HTMLorSVGElement): string;\nfunction clientWidth(element: HTMLorSVGElement, propertyValue: string): void;\nfunction clientWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\n\tif (propertyValue == null) {\n\t\treturn element.clientWidth + \"px\";\n\t}\n}\n\n/**\n * Get the scrollWidth of an element.\n */\nfunction scrollWidth(element: HTMLorSVGElement): string;\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue: string): void;\nfunction scrollWidth(element: HTMLorSVGElement, propertyValue?: string): string | void {\n\tif (propertyValue == null) {\n\t\treturn element.scrollWidth + \"px\";\n\t}\n}\n\n/**\n * Get the scrollHeight of an element.\n */\nfunction clientHeight(element: HTMLorSVGElement): string;\nfunction clientHeight(element: HTMLorSVGElement, propertyValue: string): void;\nfunction clientHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\n\tif (propertyValue == null) {\n\t\treturn element.clientHeight + \"px\";\n\t}\n}\n\n/**\n * Get the scrollHeight of an element.\n */\nfunction scrollHeight(element: HTMLorSVGElement): string;\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue: string): void;\nfunction scrollHeight(element: HTMLorSVGElement, propertyValue?: string): string | void {\n\tif (propertyValue == null) {\n\t\treturn element.scrollHeight + \"px\";\n\t}\n}\n\n/**\n * Scroll an element.\n */\nfunction scroll(direction: \"Height\", end: \"Top\"): VelocityNormalizationsFn;\nfunction scroll(direction: \"Width\", end: \"Left\"): VelocityNormalizationsFn;\nfunction scroll(direction: \"Height\" | \"Width\", end: \"Top\" | \"Left\"): VelocityNormalizationsFn {\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\n\t\tif (propertyValue == null) {\n\t\t\t// Make sure we have these values cached.\n\t\t\tgetPropertyValue(element, \"client\" + direction, null, true);\n\t\t\tgetPropertyValue(element, \"scroll\" + direction, null, true);\n\n\t\t\treturn element[\"scroll\" + end] + \"px\";\n\t\t}\n\t\tconst value = parseFloat(propertyValue),\n\t\t\tunit = propertyValue.replace(String(value), \"\");\n\n\t\tswitch (unit) {\n\t\t\tcase \"\":\n\t\t\tcase \"px\":\n\t\t\t\telement[\"scroll\" + end] = value;\n\t\t\t\tbreak;\n\n\t\t\tcase \"%\":\n\t\t\t\tconst client = parseFloat(getPropertyValue(element, \"client\" + direction)),\n\t\t\t\t\tscrollValue = parseFloat(getPropertyValue(element, \"scroll\" + direction));\n\n\t\t\t\telement[\"scroll\" + end] = Math.max(0, scrollValue - client) * value / 100;\n\t\t\t\tbreak;\n\t\t}\n\t}) as VelocityNormalizationsFn;\n}\n\nregisterNormalization([\"HTMLElement\", \"scroll\", scroll(\"Height\", \"Top\"), false]);\nregisterNormalization([\"HTMLElement\", \"scrollTop\", scroll(\"Height\", \"Top\"), false]);\nregisterNormalization([\"HTMLElement\", \"scrollLeft\", scroll(\"Width\", \"Left\"), false]);\nregisterNormalization([\"HTMLElement\", \"scrollWidth\", scrollWidth]);\nregisterNormalization([\"HTMLElement\", \"clientWidth\", clientWidth]);\nregisterNormalization([\"HTMLElement\", \"scrollHeight\", scrollHeight]);\nregisterNormalization([\"HTMLElement\", \"clientHeight\", clientHeight]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * This handles all CSS style properties. With browser prefixed properties it\n * will register a version that handles setting (and getting) both the prefixed\n * and non-prefixed version.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../velocity.d\";\n\n// Project\nimport {ALL_VENDOR_PREFIXES} from \"../../constants\";\nimport {isString} from \"../../types\";\nimport {computePropertyValue} from \"../css/getPropertyValue\";\nimport {State} from \"../state\";\nimport {hasNormalization, registerNormalization} from \"./normalizations\";\n\n/**\n * An RegExp pattern for the following list of css words using\n * http://kemio.com.ar/tools/lst-trie-re.php to generate:\n *\n * blockSize\n * borderBottomLeftRadius\n * borderBottomRightRadius\n * borderBottomWidth\n * borderImageOutset\n * borderImageWidth\n * borderLeftWidth\n * borderRadius\n * borderRightWidth\n * borderSpacing\n * borderTopLeftRadius\n * borderTopRightRadius\n * borderTopWidth\n * borderWidth\n * bottom\n * columnGap\n * columnRuleWidth\n * columnWidth\n * flexBasis\n * fontSize\n * gridColumnGap\n * gridGap\n * gridRowGap\n * height\n * inlineSize\n * left\n * letterSpacing\n * margin\n * marginBottom\n * marginLeft\n * marginRight\n * marginTop\n * maxBlockSize\n * maxHeight\n * maxInlineSize\n * maxWidth\n * minBlockSize\n * minHeight\n * minInlineSize\n * minWidth\n * objectPosition\n * outlineOffset\n * outlineWidth\n * padding\n * paddingBottom\n * paddingLeft\n * paddingRight\n * paddingTop\n * perspective\n * right\n * shapeMargin\n * strokeDashoffset\n * strokeWidth\n * textIndent\n * top\n * transformOrigin\n * width\n * wordSpacing\n */\n// tslint:disable-next-line:max-line-length\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))$/;\n\n/**\n * Return a Normalisation that can be used to set / get a prefixed style\n * property.\n */\nfunction getSetPrefixed(propertyName: string, unprefixed: string) {\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\n\t\tif (propertyValue === undefined) {\n\t\t\treturn computePropertyValue(element, propertyName) || computePropertyValue(element, unprefixed);\n\t\t}\n\t\telement.style[propertyName] = element.style[unprefixed] = propertyValue;\n\t}) as VelocityNormalizationsFn;\n}\n\n/**\n * Return a Normalisation that can be used to set / get a style property.\n */\nfunction getSetStyle(propertyName: string) {\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\n\t\tif (propertyValue === undefined) {\n\t\t\treturn computePropertyValue(element, propertyName);\n\t\t}\n\t\telement.style[propertyName] = propertyValue;\n\t}) as VelocityNormalizationsFn;\n}\n\n/**\n * Vendor prefixes. Chrome / Safari, Firefox, IE / Edge, Opera.\n */\nconst rxVendors = /^(webkit|moz|ms|o)[A-Z]/,\n\tprefixElement = State.prefixElement;\n\nif (prefixElement) {\n\tfor (const propertyName in prefixElement.style) {\n\t\tif (rxVendors.test(propertyName)) {\n\t\t\tconst unprefixed = propertyName.replace(/^[a-z]+([A-Z])/, ($, letter: string) => letter.toLowerCase());\n\n\t\t\tif (ALL_VENDOR_PREFIXES || isString(prefixElement.style[unprefixed])) {\n\t\t\t\tconst addUnit = rxAddPx.test(unprefixed) ? \"px\" : undefined;\n\n\t\t\t\tregisterNormalization([\"Element\", unprefixed, getSetPrefixed(propertyName, unprefixed), addUnit]);\n\t\t\t}\n\t\t} else if (!hasNormalization([\"Element\", propertyName])) {\n\t\t\tconst addUnit = rxAddPx.test(propertyName) ? \"px\" : undefined;\n\n\t\t\tregisterNormalization([\"Element\", propertyName, getSetStyle(propertyName), addUnit]);\n\t\t}\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {VelocityNormalizationsFn} from \"../../../../velocity.d\";\n\n// Project\nimport {isFunction, isString} from \"../../../types\";\nimport {registerNormalization} from \"../normalizations\";\n\n/**\n * Get/set an attribute.\n */\nfunction getAttribute(name: string) {\n\treturn ((element: Element, propertyValue?: string): string | void => {\n\t\tif (propertyValue === undefined) {\n\t\t\treturn element.getAttribute(name);\n\t\t}\n\t\telement.setAttribute(name, propertyValue);\n\t}) as VelocityNormalizationsFn;\n}\n\nconst base = document.createElement(\"div\"),\n\trxSubtype = /^SVG(.*)Element$/,\n\trxElement = /Element$/;\n\nObject.getOwnPropertyNames(window)\n\t.forEach((property) => {\n\t\tconst subtype = rxSubtype.exec(property);\n\n\t\tif (subtype && subtype[1] !== \"SVG\") { // Don't do SVGSVGElement.\n\t\t\ttry {\n\t\t\t\tconst element = subtype[1] ? document.createElementNS(\"http://www.w3.org/2000/svg\", (subtype[1] || \"svg\").toLowerCase()) : document.createElement(\"svg\");\n\n\t\t\t\t// tslint:disable-next-line:forin\n\t\t\t\tfor (const attribute in element) {\n\t\t\t\t\t// Although this isn't a tween without prototypes, we do\n\t\t\t\t\t// want to get hold of all attributes and not just own ones.\n\t\t\t\t\tconst value = element[attribute];\n\n\t\t\t\t\tif (isString(attribute)\n\t\t\t\t\t\t&& !(attribute[0] === \"o\" && attribute[1] === \"n\")\n\t\t\t\t\t\t&& attribute !== attribute.toUpperCase()\n\t\t\t\t\t\t&& !rxElement.test(attribute)\n\t\t\t\t\t\t&& !(attribute in base)\n\t\t\t\t\t\t&& !isFunction(value)) {\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\n\t\t\t\t\t\tregisterNormalization([property, attribute, getAttribute(attribute)]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(`VelocityJS: Error when trying to identify SVG attributes on ${property}.`, e);\n\t\t\t}\n\t\t}\n\t});\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement, VelocityNormalizationsFn} from \"../../../../velocity.d\";\n\n// Project\nimport {registerNormalization} from \"../normalizations\";\n\n/**\n * Get/set the width or height.\n */\nfunction getDimension(name: string) {\n\treturn ((element: HTMLorSVGElement, propertyValue?: string): string | void => {\n\t\tif (propertyValue === undefined) {\n\t\t\t// Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM.\n\t\t\ttry {\n\t\t\t\treturn (element as SVGGraphicsElement).getBBox()[name] + \"px\";\n\t\t\t} catch (e) {\n\t\t\t\treturn \"0px\";\n\t\t\t}\n\t\t}\n\t\telement.setAttribute(name, propertyValue);\n\t}) as VelocityNormalizationsFn;\n}\n\nregisterNormalization([\"SVGElement\", \"width\", getDimension(\"width\")]);\nregisterNormalization([\"SVGElement\", \"height\", getDimension(\"height\")]);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {HTMLorSVGElement} from \"../../../velocity.d\";\n\n// Project\nimport {registerNormalization} from \"./normalizations\";\n\n/**\n * A fake normalization used to allow the \"tween\" property easy access.\n */\nfunction getSetTween(element: HTMLorSVGElement, propertyValue?: string) {\n\tif (propertyValue === undefined) {\n\t\treturn \"\";\n\t}\n}\n\nregisterNormalization([\"Element\", \"tween\", getSetTween]);\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.6\";\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Extended Velocity members.\n */\n\n// Typedefs\nimport {\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\n} from \"./../velocity.d\";\n\n// Project\nimport { defineProperty } from \"./utility\";\nimport { Actions as ActionsObject } from \"./Velocity/actions/actions\";\nimport { defaults as DefaultObject } from \"./Velocity/defaults\";\nimport { Easings as EasingsObject } from \"./Velocity/easing/easings\";\nimport { patch as patchFn } from \"./Velocity/patch\";\nimport { SequencesObject } from \"./Velocity/sequencesObject\";\nimport { State as StateObject } from \"./Velocity/state\";\nimport { Velocity as VelocityFn } from \"./velocityFn\";\n\n// Build the entire library, even optional bits.\nimport \"./Velocity/_all\";\n\n// Constants\nimport { VERSION } from \"../version\";\nconst Velocity: VelocityPublic = VelocityFn as any;\n\n/**\n * These parts of Velocity absolutely must be included, even if they're unused!\n */\nnamespace VelocityStatic {\n\t/**\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\n\t * but they still exist). Otherwise they can be replaced by users.\n\t *\n\t * All external method calls should be using actions rather than sub-calls\n\t * of Velocity itself.\n\t */\n\texport const Actions: { [name: string]: VelocityActionFn } = ActionsObject;\n\n\t/**\n\t * Our known easing functions.\n\t */\n\texport const Easings: { [name: string]: VelocityEasingFn } = EasingsObject;\n\n\t/**\n\t * The currently registered sequences.\n\t */\n\texport const Sequences: { [name: string]: SequenceList } = SequencesObject;\n\n\t/**\n\t * Current internal state of Velocity.\n\t */\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\n\n\t/**\n\t * Velocity option defaults, which can be overriden by the user.\n\t */\n\texport const defaults: StrictVelocityOptions & { reset?: () => void } = DefaultObject as any;\n\n\t/**\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\n\t * object must either be treatable as an array - with a <code>.length</code>\n\t * property, and each member a Node, or a Node directly.\n\t *\n\t * By default Velocity will try to patch <code>window</code>,\n\t * <code>jQuery</code>, <code>Zepto</code>, and several classes that return\n\t * Nodes or lists of Nodes.\n\t */\n\texport const patch = patchFn;\n\n\t/**\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\n\t */\n\texport let debug: boolean | 1 | 2 = false;\n\n\t/**\n\t * In mock mode, all animations are forced to complete immediately upon the\n\t * next rAF tick. If there are further animations queued then they will each\n\t * take one single frame in turn. Loops and repeats will be disabled while\n\t * <code>mock = true</code>.\n\t */\n\texport let mock: boolean = false;\n\n\t/**\n\t * Save our version number somewhere visible.\n\t */\n\texport const version = VERSION;\n\n\t/**\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\n\t */\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\n}\n\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\nconst IE = (() => {\n\tinterface IEDocument extends Document {\n\t\tdocumentMode: any; // IE\n\t}\n\n\tif ((document as IEDocument).documentMode) {\n\t\treturn (document as IEDocument).documentMode;\n\t} else {\n\t\tfor (let i = 7; i > 4; i--) {\n\t\t\tlet div = document.createElement(\"div\");\n\n\t\t\tdiv.innerHTML = `<!${\"--\"}[if IE ${i}]><span></span><![endif]-->`;\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\n\t\t\t\tdiv = null;\n\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n})();\n\n/******************\n Unsupported\n ******************/\n\nif (IE <= 8) {\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\n}\n\n/******************\n Frameworks\n ******************/\n\nif (window) {\n\t/*\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\n\t * wrapped elements to be subjected to plugin calls. If either framework is\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\n\t * animate() method. Velocity also registers itself onto a global container\n\t * (window.jQuery || window.Zepto || window) so that certain features are\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\n\t * elements.\n\t */\n\tconst jQuery: { fn: any } = (window as any).jQuery,\n\t\tZepto: { fn: any } = (window as any).Zepto;\n\n\tpatchFn(window, true);\n\tpatchFn(Element && Element.prototype);\n\tpatchFn(NodeList && NodeList.prototype);\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\n\n\tpatchFn(jQuery, true);\n\tpatchFn(jQuery && jQuery.fn);\n\n\tpatchFn(Zepto, true);\n\tpatchFn(Zepto && Zepto.fn);\n}\n\n// Make sure that the values within Velocity are read-only and upatchable.\nfor (const property in VelocityStatic) {\n\tif (VelocityStatic.hasOwnProperty(property)) {\n\t\tswitch (typeof property) {\n\t\t\tcase \"number\":\n\t\t\tcase \"boolean\":\n\t\t\t\tdefineProperty(Velocity, property, {\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn VelocityStatic[property];\n\t\t\t\t\t},\n\t\t\t\t\tset(value) {\n\t\t\t\t\t\t(VelocityStatic[property] as any) = value;\n\t\t\t\t\t},\n\t\t\t\t}, true);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nObject.freeze(Velocity);\n\nexport default Velocity; // tslint:disable-line:no-default-export\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Typedefs\nimport {AnimationCall, SequenceList, VelocitySequence, VelocityTween} from \"../../velocity.d\";\n\n// Project\nimport {isNumber, isPlainObject, isString} from \"../types\";\nimport Velocity from \"../velocity\";\nimport {registerAction} from \"./actions/actions\";\nimport {camelCase} from \"./camelCase\";\nimport {getNormalization} from \"./normalizations/normalizations\";\nimport {validateDuration, validateEasing} from \"./options\";\nimport {SequencesObject} from \"./sequencesObject\";\nimport {findPattern} from \"./tweens\";\n\n// Constants\nimport {DEFAULT_DURATION} from \"../constants\";\n\nconst rxPercents = /(\\d*\\.\\d+|\\d+\\.?|from|to)/g;\n\nexport function expandSequence(animation: AnimationCall, sequence: SequenceList) {\n\tconst tweens = animation.tweens = Object.create(null),\n\t\telement = animation.element;\n\n\tfor (const propertyName in sequence.tweens) {\n\t\tif (sequence.tweens.hasOwnProperty(propertyName)) {\n\t\t\tconst fn = getNormalization(element, propertyName);\n\n\t\t\tif (!fn && propertyName !== \"tween\") {\n\t\t\t\tif (Velocity.debug) {\n\t\t\t\t\tconsole.log(`Skipping [${propertyName}] due to a lack of browser support.`);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttweens[propertyName] = {\n\t\t\t\tfn,\n\t\t\t\tsequence: sequence.tweens[propertyName],\n\t\t\t} as VelocityTween;\n\t\t}\n\t}\n}\n\n/**\n * Used to register a sequence. This should never be called by users\n * directly, instead it should be called via an action:<br/>\n * <code>Velocity(\"registerSequence\", \"\"name\", VelocitySequence);</code>\n */\nexport function registerSequence(args?: [string, VelocitySequence] | [{[name: string]: VelocitySequence}]) {\n\tif (isPlainObject(args[0])) {\n\t\tfor (const name in (args[0] as {[name: string]: VelocitySequence})) {\n\t\t\tif (args[0].hasOwnProperty(name)) {\n\t\t\t\tregisterSequence([name, args[0][name]]);\n\t\t\t}\n\t\t}\n\t} else if (isString(args[0])) {\n\t\tconst name = args[0] as string,\n\t\t\tsequence = args[1] as VelocitySequence;\n\n\t\tif (!isString(name)) {\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' name to an invalid value:`, name);\n\t\t} else if (!isPlainObject(sequence)) {\n\t\t\tconsole.warn(`VelocityJS: Trying to set 'registerSequence' sequence to an invalid value:`, name, sequence);\n\t\t} else {\n\t\t\tif (SequencesObject[name]) {\n\t\t\t\tconsole.warn(`VelocityJS: Replacing named sequence:`, name);\n\t\t\t}\n\t\t\tconst percents: {[key: string]: string[]} = {},\n\t\t\t\tsteps: string[] = new Array(100),\n\t\t\t\tproperties: string[] = [],\n\t\t\t\tpercentages: string[] = [],\n\t\t\t\tsequenceList: SequenceList = SequencesObject[name] = {} as any,\n\t\t\t\tduration = validateDuration((sequence as any).duration);\n\n\t\t\tsequenceList.tweens = {};\n\t\t\tif (isNumber(duration)) {\n\t\t\t\tsequenceList.duration = duration;\n\t\t\t}\n\t\t\tfor (const part in sequence) {\n\t\t\t\tif (sequence.hasOwnProperty(part)) {\n\t\t\t\t\tconst keys = String(part)\n\t\t\t\t\t\t.match(rxPercents);\n\n\t\t\t\t\tif (keys) {\n\t\t\t\t\t\tpercentages.push(part);\n\t\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\t\t\tconst percent = key === \"from\"\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: key === \"to\"\n\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t: parseFloat(key);\n\n\t\t\t\t\t\t\tif (percent < 0 || percent > 100) {\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);\n\t\t\t\t\t\t\t} else if (isNaN(percent)) {\n\t\t\t\t\t\t\t\tconsole.warn(`VelocityJS: Trying to use an invalid number as a percentage:`, name, part, key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (!percents[String(percent)]) {\n\t\t\t\t\t\t\t\t\tpercents[String(percent)] = [];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpercents[String(percent)].push(part);\n\t\t\t\t\t\t\t\tfor (const property in sequence[part]) {\n\t\t\t\t\t\t\t\t\tif (!properties.includes(property)) {\n\t\t\t\t\t\t\t\t\t\tproperties.push(property);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst orderedPercents = Object.keys(percents)\n\t\t\t\t.sort((a, b) => {\n\t\t\t\t\tconst a1 = parseFloat(a),\n\t\t\t\t\t\tb1 = parseFloat(b);\n\n\t\t\t\t\treturn a1 > b1 ? 1 : a1 < b1 ? -1 : 0;\n\t\t\t\t});\n\n\t\t\torderedPercents.forEach((key) => {\n\t\t\t\tsteps.push.apply(percents[key]);\n\t\t\t});\n\t\t\tfor (const property of properties) {\n\t\t\t\tconst parts: string[] = [],\n\t\t\t\t\tpropertyName = camelCase(property);\n\n\t\t\t\tfor (const key of orderedPercents) {\n\t\t\t\t\tfor (const value of percents[key]) {\n\t\t\t\t\t\tconst stepProperties = sequence[value];\n\n\t\t\t\t\t\tif (stepProperties[propertyName]) {\n\t\t\t\t\t\t\tparts.push(isString(stepProperties[propertyName])\n\t\t\t\t\t\t\t\t? stepProperties[propertyName]\n\t\t\t\t\t\t\t\t: stepProperties[propertyName][0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parts.length) {\n\t\t\t\t\tconst realSequence = findPattern(parts, propertyName);\n\t\t\t\t\tlet index = 0;\n\n\t\t\t\t\tif (realSequence) {\n\t\t\t\t\t\tfor (const key of orderedPercents) {\n\t\t\t\t\t\t\tfor (const value of percents[key]) {\n\t\t\t\t\t\t\t\tconst originalProperty = sequence[value][propertyName];\n\n\t\t\t\t\t\t\t\tif (originalProperty) {\n\t\t\t\t\t\t\t\t\tif (Array.isArray(originalProperty) && originalProperty.length > 1 && (isString(originalProperty[1]) || Array.isArray(originalProperty[1]))) {\n\t\t\t\t\t\t\t\t\t\trealSequence[index].easing = validateEasing(originalProperty[1], sequenceList.duration || DEFAULT_DURATION);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trealSequence[index++].percent = parseFloat(key) / 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsequenceList.tweens[propertyName] = realSequence;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nregisterAction([\"registerSequence\", registerSequence], true);\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Core \"Velocity\" function.\n */\n\n// Typedefs\nimport {\n\tAnimationCall, AnimationFlags, HTMLorSVGElement, Properties, StrictVelocityOptions,\n\tVelocityElements, VelocityObjectArgs, VelocityOptionFn, VelocityOptions, VelocityPromise,\n\tVelocityProperty, VelocityResult,\n} from \"./../velocity.d\";\n\n// Project\nimport { isBoolean, isFunction, isNode, isNumber, isPlainObject, isString, isVelocityResult, isWrapped } from \"./types\";\nimport { cloneArray, defineProperty, getValue } from \"./utility\";\nimport { Data } from \"./Velocity/data\";\nimport {\n\tvalidateBegin, validateComplete, validateDelay, validateDuration, validateEasing,\n\tvalidateLoop, validateProgress, validateQueue, validateRepeat, validateSpeed, validateSync,\n} from \"./Velocity/options\";\nimport { patch as patchFn } from \"./Velocity/patch\";\nimport { queue } from \"./Velocity/queue\";\nimport { expandSequence } from \"./Velocity/sequences\";\nimport { tick } from \"./Velocity/tick\";\nimport { expandProperties } from \"./Velocity/tweens\";\n\nimport { Actions as ActionsObject } from \"./Velocity/actions/actions\";\nimport { defaults as DefaultObject } from \"./Velocity/defaults\";\nimport { SequencesObject } from \"./Velocity/sequencesObject\";\nimport { State as StateObject } from \"./Velocity/state\";\n\nlet globalPromise: PromiseConstructor;\n\ntry {\n\tglobalPromise = Promise;\n} catch {/**/ }\n\nconst noPromiseOption = \", if that is deliberate then pass `promiseRejectEmpty:false` as an option\";\n\n/**\n * Patch a VelocityResult with a Promise.\n */\nfunction patchPromise(promiseObject: Promise<any>, result: VelocityResult) {\n\tdefineProperty(result, \"promise\", promiseObject);\n\tdefineProperty(result, \"then\", promiseObject.then.bind(promiseObject));\n\tdefineProperty(result, \"catch\", promiseObject.catch.bind(promiseObject));\n\tif ((promiseObject as any).finally) {\n\t\t// Semi-standard\n\t\tdefineProperty(result, \"finally\", (promiseObject as any).finally.bind(promiseObject));\n\t}\n}\n\n/* tslint:disable:max-line-length */\n/**\n * The main Velocity function. Acts as a gateway to everything else.\n */\nexport function Velocity(options: VelocityObjectArgs): VelocityResult;\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties<VelocityProperty>, options?: VelocityOptions): VelocityResult;\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties<VelocityProperty>, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties<VelocityProperty>, complete?: () => void): VelocityResult;\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties<VelocityProperty>, easing?: string | number[], complete?: () => void): VelocityResult;\nexport function Velocity(elements: VelocityElements, propertyMap: string | Properties<VelocityProperty>, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties<VelocityProperty>, duration?: number | \"fast\" | \"normal\" | \"slow\", complete?: () => void): VelocityResult;\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties<VelocityProperty>, complete?: () => void): VelocityResult;\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties<VelocityProperty>, easing?: string | number[], complete?: () => void): VelocityResult;\nexport function Velocity(this: VelocityElements, propertyMap: string | Properties<VelocityProperty>, duration?: number | \"fast\" | \"normal\" | \"slow\", easing?: string | number[], complete?: () => void): VelocityResult;\n/* tslint:enable:max-line-length */\nexport function Velocity(this: VelocityElements | void, ...args: any[]): VelocityResult {\n\tconst\n\t\t/**\n\t\t * A shortcut to the default options.\n\t\t */\n\t\tdefaults = DefaultObject,\n\t\t/**\n\t\t * Cache of the first argument - this is used often enough to be saved.\n\t\t */\n\t\targs0 = args[0] as VelocityObjectArgs,\n\t\t/**\n\t\t * To allow for expressive CoffeeScript code, Velocity supports an\n\t\t * alternative syntax in which \"elements\" (or \"e\"), \"properties\" (or\n\t\t * \"p\"), and \"options\" (or \"o\") objects are defined on a container\n\t\t * object that's passed in as Velocity's sole argument.\n\t\t *\n\t\t * Note: Some browsers automatically populate arguments with a\n\t\t * \"properties\" object. We detect it by checking for its default\n\t\t * \"names\" property.\n\t\t */\n\t\t// TODO: Confirm which browsers - if <=IE8 the we can drop completely\n\t\tsyntacticSugar = isPlainObject(args0) && (args0.p || ((isPlainObject(args0.properties) && !(args0.properties as any).names) || isString(args0.properties)));\n\tlet\n\t\t/**\n\t\t * When Velocity is called via the utility function (Velocity()),\n\t\t * elements are explicitly passed in as the first parameter. Thus,\n\t\t * argument positioning varies.\n\t\t */\n\t\targumentIndex: number = 0,\n\t\t/**\n\t\t * The list of elements, extended with Promise and Velocity.\n\t\t */\n\t\telements: VelocityResult,\n\t\t/**\n\t\t * The properties being animated. This can be a string, in which case it\n\t\t * is either a function for these elements, or it is a \"named\" animation\n\t\t * sequence to use instead. Named sequences start with either \"callout.\"\n\t\t * or \"transition.\". When used as a callout the values will be reset\n\t\t * after finishing. When used as a transtition then there is no special\n\t\t * handling after finishing.\n\t\t */\n\t\tpropertiesMap: string | Properties<VelocityProperty>,\n\t\t/**\n\t\t * Options supplied, this will be mapped and validated into\n\t\t * <code>options</code>.\n\t\t */\n\t\toptionsMap: VelocityOptions,\n\t\t/**\n\t\t * If called via a chain then this contains the <b>last</b> calls\n\t\t * animations. If this does not have a value then any access to the\n\t\t * element's animations needs to be to the currently-running ones.\n\t\t */\n\t\tanimations: AnimationCall[],\n\t\t/**\n\t\t * The promise that is returned.\n\t\t */\n\t\tpromise: Promise<VelocityResult>,\n\t\t// Used when the animation is finished\n\t\tresolver: (value?: VelocityResult) => void,\n\t\t// Used when there was an issue with one or more of the Velocity arguments\n\t\trejecter: (reason: any) => void;\n\n\t//console.log(`Velocity`, args)\n\t// First get the elements, and the animations connected to the last call if\n\t// this is chained.\n\t// TODO: Clean this up a bit\n\t// TODO: Throw error if the chain is called with elements as the first argument. isVelocityResult(this) && ( (isNode(arg0) || isWrapped(arg0)) && arg0 == this)\n\tif (isNode(this)) {\n\t\t// This is from a chain such as document.getElementById(\"\").velocity(...)\n\t\telements = [this as HTMLorSVGElement] as VelocityResult;\n\t} else if (isWrapped(this)) {\n\t\t// This might be a chain from something else, but if chained from a\n\t\t// previous Velocity() call then grab the animations it's related to.\n\t\telements = cloneArray(this as HTMLorSVGElement[]) as VelocityResult;\n\t\tif (isVelocityResult(this)) {\n\t\t\tanimations = (this as VelocityResult).velocity.animations;\n\t\t}\n\t} else if (syntacticSugar) {\n\t\telements = cloneArray(args0.elements || args0.e) as VelocityResult;\n\t\targumentIndex++;\n\t} else if (isNode(args0)) {\n\t\telements = cloneArray([args0]) as VelocityResult;\n\t\targumentIndex++;\n\t} else if (isWrapped(args0)) {\n\t\telements = cloneArray(args0) as VelocityResult;\n\t\targumentIndex++;\n\t}\n\t// Allow elements to be chained.\n\tif (elements) {\n\t\tdefineProperty(elements, \"velocity\", Velocity.bind(elements));\n\t\tif (animations) {\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\n\t\t}\n\t}\n\t// Next get the propertiesMap and options.\n\tif (syntacticSugar) {\n\t\tpropertiesMap = getValue(args0.properties, args0.p);\n\t} else {\n\t\t// TODO: Should be possible to call Velocity(\"pauseAll\") - currently not possible\n\t\tpropertiesMap = args[argumentIndex++] as string | Properties<VelocityProperty>;\n\t}\n\t// Get any options map passed in as arguments first, expand any direct\n\t// options if possible.\n\tconst isReverse = propertiesMap === \"reverse\",\n\t\tisAction = !isReverse && isString(propertiesMap),\n\t\tmaybeSequence = isAction && SequencesObject[propertiesMap as string],\n\t\topts = syntacticSugar ? getValue(args0.options, args0.o) : args[argumentIndex];\n\n\tif (isPlainObject(opts)) {\n\t\toptionsMap = opts;\n\t}\n\t// Create the promise if supported and wanted.\n\tif (globalPromise && getValue(optionsMap && optionsMap.promise, defaults.promise)) {\n\t\tpromise = new globalPromise((resolve, reject) => {\n\t\t\trejecter = reject;\n\t\t\t// IMPORTANT:\n\t\t\t// If a resolver tries to run on a Promise then it will wait until\n\t\t\t// that Promise resolves - but in this case we're running on our own\n\t\t\t// Promise, so need to make sure it's not seen as one. Removing\n\t\t\t// these values for the duration of the resolve.\n\t\t\t// Due to being an async call, they should be back to \"normal\"\n\t\t\t// before the <code>.then()</code> function gets called.\n\t\t\tresolver = (result: VelocityResult) => {\n\t\t\t\tif (isVelocityResult(result) && result.promise) {\n\t\t\t\t\tdelete result.then;\n\t\t\t\t\tdelete result.catch;\n\t\t\t\t\tdelete (result as any).finally;\n\t\t\t\t\tresolve(result);\n\t\t\t\t\tpatchPromise(result.promise, result);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(result);\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t\tif (elements) {\n\t\t\tpatchPromise(promise, elements);\n\t\t}\n\t}\n\tif (promise) {\n\t\tconst optionPromiseRejectEmpty = optionsMap && optionsMap.promiseRejectEmpty,\n\t\t\tpromiseRejectEmpty: boolean = getValue(optionPromiseRejectEmpty, defaults.promiseRejectEmpty);\n\n\t\tif (!elements && !isAction) {\n\t\t\tif (promiseRejectEmpty) {\n\t\t\t\trejecter(`Velocity: No elements supplied${isBoolean(optionPromiseRejectEmpty) ? \"\" : noPromiseOption}. Aborting.`);\n\t\t\t} else {\n\t\t\t\tresolver();\n\t\t\t}\n\t\t} else if (!propertiesMap) {\n\t\t\tif (promiseRejectEmpty) {\n\t\t\t\trejecter(`Velocity: No properties supplied${isBoolean(optionPromiseRejectEmpty) ? \"\" : noPromiseOption}. Aborting.`);\n\t\t\t} else {\n\t\t\t\tresolver();\n\t\t\t}\n\t\t}\n\t}\n\tif ((!elements && !isAction) || !propertiesMap) {\n\t\treturn promise as any;\n\t}\n\n\t// NOTE: Can't use isAction here due to type inference - there are callbacks\n\t// between so the type isn't considered safe.\n\tif (isAction) {\n\t\tconst actionArgs: any[] = [],\n\t\t\tpromiseHandler: VelocityPromise = promise && {\n\t\t\t\t_promise: promise,\n\t\t\t\t_resolver: resolver,\n\t\t\t\t_rejecter: rejecter,\n\t\t\t};\n\n\t\twhile (argumentIndex < args.length) {\n\t\t\tactionArgs.push(args[argumentIndex++]);\n\t\t}\n\n\t\t// Velocity's behavior is categorized into \"actions\". If a string is\n\t\t// passed in instead of a propertiesMap then that will call a function\n\t\t// to do something special to the animation linked.\n\t\t// There is one special case - \"reverse\" - which is handled differently,\n\t\t// by being stored on the animation and then expanded when the animation\n\t\t// starts.\n\t\tconst action = (propertiesMap as string).replace(/\\..*$/, \"\"),\n\t\t\tcallback = ActionsObject[action];\n\n\t\tif (callback) {\n\t\t\tconst result = callback(actionArgs, elements, promiseHandler, propertiesMap as string);\n\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\treturn elements || promise as any;\n\t\t} else if (!maybeSequence) {\n\t\t\tconsole.error(`VelocityJS: First argument (${propertiesMap}) was not a property map, a known action, or a registered redirect. Aborting.`);\n\n\t\t\treturn;\n\t\t}\n\t}\n\tlet hasValidDuration: boolean;\n\n\tif (isPlainObject(propertiesMap) || isReverse || maybeSequence) {\n\t\t/**\n\t\t * The options for this set of animations.\n\t\t */\n\t\tconst options: StrictVelocityOptions = {};\n\t\tlet isSync = defaults.sync;\n\n\t\t// Private options first - set as non-enumerable, and starting with an\n\t\t// underscore so we can filter them out.\n\t\tif (promise) {\n\t\t\tdefineProperty(options, \"_promise\", promise);\n\t\t\tdefineProperty(options, \"_rejecter\", rejecter);\n\t\t\tdefineProperty(options, \"_resolver\", resolver);\n\t\t}\n\t\tdefineProperty(options, \"_ready\", 0);\n\t\tdefineProperty(options, \"_started\", 0);\n\t\tdefineProperty(options, \"_completed\", 0);\n\t\tdefineProperty(options, \"_total\", 0);\n\n\t\t// Now check the optionsMap\n\t\tif (isPlainObject(optionsMap)) {\n\t\t\tconst validDuration = validateDuration(optionsMap.duration);\n\n\t\t\thasValidDuration = validDuration !== undefined;\n\t\t\toptions.duration = getValue(validDuration, defaults.duration);\n\t\t\toptions.delay = getValue(validateDelay(optionsMap.delay), defaults.delay);\n\t\t\t// Need the extra fallback here in case it supplies an invalid\n\t\t\t// easing that we need to overrride with the default.\n\t\t\toptions.easing = validateEasing(getValue(optionsMap.easing, defaults.easing), options.duration) || validateEasing(defaults.easing, options.duration);\n\t\t\toptions.loop = getValue(validateLoop(optionsMap.loop), defaults.loop);\n\t\t\toptions.repeat = options.repeatAgain = getValue(validateRepeat(optionsMap.repeat), defaults.repeat);\n\t\t\tif (optionsMap.speed != null) {\n\t\t\t\toptions.speed = getValue(validateSpeed(optionsMap.speed), 1);\n\t\t\t}\n\t\t\tif (isBoolean(optionsMap.promise)) {\n\t\t\t\toptions.promise = optionsMap.promise;\n\t\t\t}\n\t\t\toptions.queue = getValue(validateQueue(optionsMap.queue), defaults.queue);\n\t\t\tif (optionsMap.mobileHA && !StateObject.isGingerbread) {\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)\n\t\t\t\t on animating elements. HA is removed from the element at the completion of its animation. */\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. */\n\t\t\t\t/* Note: You can read more about the use of mobileHA in Velocity's documentation: velocity-animate/#mobileHA. */\n\t\t\t\toptions.mobileHA = true;\n\t\t\t}\n\t\t\tif (optionsMap.drag === true) {\n\t\t\t\toptions.drag = true;\n\t\t\t}\n\t\t\tif (isNumber(optionsMap.stagger) || isFunction(optionsMap.stagger)) {\n\t\t\t\toptions.stagger = optionsMap.stagger;\n\t\t\t}\n\t\t\tif (!isReverse) {\n\t\t\t\tif (optionsMap[\"display\"] != null) {\n\t\t\t\t\t(propertiesMap as Properties<VelocityProperty>).display = optionsMap[\"display\"] as string;\n\t\t\t\t\tconsole.error(`Deprecated \"options.display\" used, this is now a property:`, optionsMap[\"display\"]);\n\t\t\t\t}\n\t\t\t\tif (optionsMap[\"visibility\"] != null) {\n\t\t\t\t\t(propertiesMap as Properties<VelocityProperty>).visibility = optionsMap[\"visibility\"] as string;\n\t\t\t\t\tconsole.error(`Deprecated \"options.visibility\" used, this is now a property:`, optionsMap[\"visibility\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: Allow functional options for different options per element\n\t\t\tconst optionsBegin = validateBegin(optionsMap.begin),\n\t\t\t\toptionsComplete = validateComplete(optionsMap.complete),\n\t\t\t\toptionsProgress = validateProgress(optionsMap.progress),\n\t\t\t\toptionsSync = validateSync(optionsMap.sync);\n\n\t\t\tif (optionsBegin != null) {\n\t\t\t\toptions.begin = optionsBegin;\n\t\t\t}\n\t\t\tif (optionsComplete != null) {\n\t\t\t\toptions.complete = optionsComplete;\n\t\t\t}\n\t\t\tif (optionsProgress != null) {\n\t\t\t\toptions.progress = optionsProgress;\n\t\t\t}\n\t\t\tif (optionsSync != null) {\n\t\t\t\tisSync = optionsSync;\n\t\t\t}\n\t\t} else if (!syntacticSugar) {\n\t\t\t// Expand any direct options if possible.\n\t\t\tlet offset = 0;\n\n\t\t\toptions.duration = validateDuration(args[argumentIndex], true);\n\t\t\tif (options.duration === undefined) {\n\t\t\t\toptions.duration = defaults.duration;\n\t\t\t} else {\n\t\t\t\thasValidDuration = true;\n\t\t\t\toffset++;\n\t\t\t}\n\t\t\tif (!isFunction(args[argumentIndex + offset])) {\n\t\t\t\t// Despite coming before Complete, we can't pass a fn easing\n\t\t\t\tconst easing = validateEasing(args[argumentIndex + offset], getValue(options && validateDuration(options.duration), defaults.duration) as number, true);\n\n\t\t\t\tif (easing !== undefined) {\n\t\t\t\t\toffset++;\n\t\t\t\t\toptions.easing = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst complete = validateComplete(args[argumentIndex + offset], true);\n\n\t\t\tif (complete !== undefined) {\n\t\t\t\toptions.complete = complete;\n\t\t\t}\n\t\t\toptions.delay = defaults.delay;\n\t\t\toptions.loop = defaults.loop;\n\t\t\toptions.repeat = options.repeatAgain = defaults.repeat;\n\t\t}\n\n\t\tif (isReverse && options.queue === false) {\n\t\t\tthrow new Error(\"VelocityJS: Cannot reverse a queue:false animation.\");\n\t\t}\n\n\t\tif (!hasValidDuration && maybeSequence && maybeSequence.duration) {\n\t\t\toptions.duration = maybeSequence.duration;\n\t\t}\n\n\t\t// When a set of elements is targeted by a Velocity call, the set is\n\t\t// broken up and each element has the current Velocity call individually\n\t\t// queued onto it. In this way, each element's existing queue is\n\t\t// respected; some elements may already be animating and accordingly\n\t\t// should not have this current Velocity call triggered immediately\n\t\t// unless the sync:true option is used.\n\n\t\tconst rootAnimation: AnimationCall = {\n\t\t\toptions,\n\t\t\telements,\n\t\t\t_prev: undefined,\n\t\t\t_next: undefined,\n\t\t\t_flags: isSync ? AnimationFlags.SYNC : 0,\n\t\t\tpercentComplete: 0,\n\t\t\tellapsedTime: 0,\n\t\t\ttimeStart: 0,\n\t\t};\n\n\t\tanimations = [];\n\t\tfor (let index = 0; index < elements.length; index++) {\n\t\t\tconst element = elements[index];\n\t\t\tlet flags = 0;\n\n\t\t\tif (isNode(element)) { // TODO: This needs to check for valid animation targets, not just Elements\n\t\t\t\tif (isReverse) {\n\t\t\t\t\tconst lastAnimation = Data(element).lastAnimationList[options.queue as string];\n\n\t\t\t\t\tpropertiesMap = lastAnimation && lastAnimation.tweens as any;\n\t\t\t\t\tif (!propertiesMap) {\n\t\t\t\t\t\tconsole.error(`VelocityJS: Attempting to reverse an animation on an element with no previous animation:`, element);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tflags |= AnimationFlags.REVERSE & ~(lastAnimation._flags & AnimationFlags.REVERSE); // tslint:disable-line:no-bitwise\n\t\t\t\t}\n\t\t\t\tconst animation: AnimationCall = {\n\t\t\t\t\t...rootAnimation,\n\t\t\t\t\telement,\n\t\t\t\t\t_flags: rootAnimation._flags | flags, // tslint:disable-line:no-bitwise\n\t\t\t\t};\n\n\t\t\t\toptions._total++;\n\t\t\t\tanimations.push(animation);\n\t\t\t\tif (options.stagger) {\n\t\t\t\t\tif (isFunction(options.stagger)) {\n\t\t\t\t\t\tconst num = optionCallback(options.stagger, element, index, elements.length, elements, \"stagger\");\n\n\t\t\t\t\t\tif (isNumber(num)) {\n\t\t\t\t\t\t\tanimation.delay = options.delay + num;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimation.delay = options.delay + (options.stagger * index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (options.drag) {\n\t\t\t\t\tanimation.duration = options.duration - (options.duration * Math.max(1 - (index + 1) / elements.length, 0.75));\n\t\t\t\t}\n\t\t\t\tif (maybeSequence) {\n\t\t\t\t\texpandSequence(animation, maybeSequence);\n\t\t\t\t} else if (isReverse) {\n\t\t\t\t\t// In this case we're using the previous animation, so\n\t\t\t\t\t// it will be expanded correctly when that one runs.\n\t\t\t\t\tanimation.tweens = propertiesMap as any;\n\t\t\t\t} else {\n\t\t\t\t\tanimation.tweens = Object.create(null);\n\t\t\t\t\texpandProperties(animation, propertiesMap);\n\t\t\t\t}\n\t\t\t\tqueue(element, animation, options.queue);\n\t\t\t}\n\t\t}\n\t\tif (StateObject.isTicking === false) {\n\t\t\t// If the animation tick isn't running, start it. (Velocity shuts it\n\t\t\t// off when there are no active calls to process.)\n\t\t\ttick(false);\n\t\t}\n\t\tif (animations) {\n\t\t\tdefineProperty(elements.velocity, \"animations\", animations);\n\t\t}\n\t}\n\t/***************\n\t Chaining\n\t ***************/\n\n\t/* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */\n\treturn elements || promise as any;\n}\n\n/**\n * Call an option callback in a try/catch block and report an error if needed.\n */\nfunction optionCallback<T>(fn: VelocityOptionFn<T>, element: HTMLorSVGElement, index: number, length: number, elements: HTMLorSVGElement[], option: string): T {\n\ttry {\n\t\treturn fn.call(element, index, length, elements, option);\n\t} catch (e) {\n\t\tconsole.error(`VelocityJS: Exception when calling '${option}' callback:`, e);\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n */\n\n// Project\nimport {defineProperty} from \"../utility\";\nimport {Velocity} from \"../velocityFn\";\n\n/**\n * Used to patch any object to allow Velocity chaining. In order to chain an\n * object must either be treatable as an array - with a <code>.length</code>\n * property, and each member a Node, or a Node directly.\n *\n * By default Velocity will try to patch <code>window</code>,\n * <code>jQuery</code>, <code>Zepto</code>, and several classes that return\n * Nodes or lists of Nodes.\n */\nexport function patch(proto: any, global?: boolean) {\n\ttry {\n\t\tdefineProperty(proto, (global ? \"V\" : \"v\") + \"elocity\", Velocity);\n\t} catch (e) {\n\t\tconsole.warn(`VelocityJS: Error when trying to add prototype.`, e);\n\t}\n}\n","/*\n * velocity-animate (C) 2014-2018 Julian Shapiro.\n *\n * Licensed under the MIT license. See LICENSE file in the project root for details.\n *\n * Extended Velocity members.\n */\n\n// Typedefs\nimport {\n\tSequenceList, StrictVelocityOptions, Velocity as VelocityPublic,\n\tVelocityActionFn, VelocityEasingFn, VelocityState,\n} from \"./../velocity.d\";\n\n// Project\nimport { defineProperty } from \"./utility\";\nimport { Actions as ActionsObject } from \"./Velocity/actions/actions\";\nimport { defaults as DefaultObject } from \"./Velocity/defaults\";\nimport { Easings as EasingsObject } from \"./Velocity/easing/easings\";\nimport { patch as patchFn } from \"./Velocity/patch\";\nimport { SequencesObject } from \"./Velocity/sequencesObject\";\nimport { State as StateObject } from \"./Velocity/state\";\nimport { Velocity as VelocityFn } from \"./velocityFn\";\n\n// Build the entire library, even optional bits.\nimport \"./Velocity/_all\";\n\n// Constants\nimport { VERSION } from \"../version\";\nconst Velocity: VelocityPublic = VelocityFn as any;\n\n/**\n * These parts of Velocity absolutely must be included, even if they're unused!\n */\nnamespace VelocityStatic {\n\t/**\n\t * Actions cannot be replaced if they are internal (hasOwnProperty is false\n\t * but they still exist). Otherwise they can be replaced by users.\n\t *\n\t * All external method calls should be using actions rather than sub-calls\n\t * of Velocity itself.\n\t */\n\texport const Actions: { [name: string]: VelocityActionFn } = ActionsObject;\n\n\t/**\n\t * Our known easing functions.\n\t */\n\texport const Easings: { [name: string]: VelocityEasingFn } = EasingsObject;\n\n\t/**\n\t * The currently registered sequences.\n\t */\n\texport const Sequences: { [name: string]: SequenceList } = SequencesObject;\n\n\t/**\n\t * Current internal state of Velocity.\n\t */\n\texport const State: VelocityState = StateObject; // tslint:disable-line:no-shadowed-variable\n\n\t/**\n\t * Velocity option defaults, which can be overriden by the user.\n\t */\n\texport const defaults: StrictVelocityOptions & { reset?: () => void } = DefaultObject as any;\n\n\t/**\n\t * Used to patch any object to allow Velocity chaining. In order to chain an\n\t * object must either be treatable as an array - with a <code>.length</code>\n\t * property, and each member a Node, or a Node directly.\n\t *\n\t * By default Velocity will try to patch <code>window</code>,\n\t * <code>jQuery</code>, <code>Zepto</code>, and several classes that return\n\t * Nodes or lists of Nodes.\n\t */\n\texport const patch = patchFn;\n\n\t/**\n\t * Set to true, 1 or 2 (most verbose) to output debug info to console.\n\t */\n\texport let debug: boolean | 1 | 2 = false;\n\n\t/**\n\t * In mock mode, all animations are forced to complete immediately upon the\n\t * next rAF tick. If there are further animations queued then they will each\n\t * take one single frame in turn. Loops and repeats will be disabled while\n\t * <code>mock = true</code>.\n\t */\n\texport let mock: boolean = false;\n\n\t/**\n\t * Save our version number somewhere visible.\n\t */\n\texport const version = VERSION;\n\n\t/**\n\t * Added as a fallback for \"import {Velocity} from 'velocity-animate';\".\n\t */\n\texport const Velocity: VelocityPublic = VelocityFn as any; // tslint:disable-line:no-shadowed-variable\n}\n\n/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */\nconst IE = (() => {\n\tinterface IEDocument extends Document {\n\t\tdocumentMode: any; // IE\n\t}\n\n\tif ((document as IEDocument).documentMode) {\n\t\treturn (document as IEDocument).documentMode;\n\t} else {\n\t\tfor (let i = 7; i > 4; i--) {\n\t\t\tlet div = document.createElement(\"div\");\n\n\t\t\tdiv.innerHTML = `<!${\"--\"}[if IE ${i}]><span></span><![endif]-->`;\n\t\t\tif (div.getElementsByTagName(\"span\").length) {\n\t\t\t\tdiv = null;\n\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n})();\n\n/******************\n Unsupported\n ******************/\n\nif (IE <= 8) {\n\tthrow new Error(\"VelocityJS cannot run on Internet Explorer 8 or earlier\");\n}\n\n/******************\n Frameworks\n ******************/\n\nif (window) {\n\t/*\n\t * Both jQuery and Zepto allow their $.fn object to be extended to allow\n\t * wrapped elements to be subjected to plugin calls. If either framework is\n\t * loaded, register a \"velocity\" extension pointing to Velocity's core\n\t * animate() method. Velocity also registers itself onto a global container\n\t * (window.jQuery || window.Zepto || window) so that certain features are\n\t * accessible beyond just a per-element scope. Accordingly, Velocity can\n\t * both act on wrapped DOM elements and stand alone for targeting raw DOM\n\t * elements.\n\t */\n\tconst jQuery: { fn: any } = (window as any).jQuery,\n\t\tZepto: { fn: any } = (window as any).Zepto;\n\n\tpatchFn(window, true);\n\tpatchFn(Element && Element.prototype);\n\tpatchFn(NodeList && NodeList.prototype);\n\tpatchFn(HTMLCollection && HTMLCollection.prototype);\n\n\tpatchFn(jQuery, true);\n\tpatchFn(jQuery && jQuery.fn);\n\n\tpatchFn(Zepto, true);\n\tpatchFn(Zepto && Zepto.fn);\n}\n\n// Make sure that the values within Velocity are read-only and upatchable.\nfor (const property in VelocityStatic) {\n\tif (VelocityStatic.hasOwnProperty(property)) {\n\t\tswitch (typeof property) {\n\t\t\tcase \"number\":\n\t\t\tcase \"boolean\":\n\t\t\t\tdefineProperty(Velocity, property, {\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn VelocityStatic[property];\n\t\t\t\t\t},\n\t\t\t\t\tset(value) {\n\t\t\t\t\t\t(VelocityStatic[property] as any) = value;\n\t\t\t\t\t},\n\t\t\t\t}, true);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tdefineProperty(Velocity, property, VelocityStatic[property], true);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nObject.freeze(Velocity);\n\nexport default Velocity; // tslint:disable-line:no-default-export\n"],"names":["isBoolean","variable","isFunction","Object","prototype","toString","call","isNode","nodeType","isNumber","isPlainObject","proto","getPrototypeOf","hasOwnProperty","constructor","isString","isVelocityResult","length","velocity","isWrapped","window","propertyIsEnumerable","obj","property","addClass","element","className","Element","classList","add","removeClass","cloneArray","arrayLike","Array","slice","defineProperty","name","value","readonly","configurable","writable","getValue","args","arg","undefined","now","Date","getTime","remove","replace","RegExp","Actions","registerAction","internal","callback","console","warn","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","linearEasing","percentComplete","startValue","endValue","swingEasing","Math","cos","PI","springEasing","exp","fixRange","num","min","max","A","aA1","aA2","B","C","calcBezier","aT","getSlope","generateBezier","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","i","isNaN","isFinite","mX1","mY1","mX2","mY2","mSampleValues","Float32Array","newtonRaphsonIterate","aX","aGuessT","currentSlope","currentX","calcSampleValues","binarySubdivide","aA","aB","currentT","abs","getTForX","lastSample","intervalStart","currentSample","dist","guessForT","initialSlope","precomputed","precompute","str","f","getControlPoints","x","y","easeIn","easeOut","easeInOut","springAccelerationForState","state","tension","friction","v","springEvaluateStateWithDerivative","initialState","dt","derivative","dx","dv","springIntegrateState","a","b","c","d","dxdt","dvdt","generateSpringRK4","duration","initState","parseFloat","path","tolerance","DT","haveDuration","timeLapsed","lastState","push","floor","cache","generateStep","steps","fn","round","parseDuration","def","toLowerCase","validateCache","validateBegin","validateComplete","noError","validateDelay","parsed","error","validateDuration","validateEasing","isArray","apply","validateFpsLimit","parseInt","validateLoop","validateProgress","validatePromise","validatePromiseRejectEmpty","validateQueue","validateRepeat","validateSpeed","validateSync","begin","complete","delay","easing","fpsLimit","loop","mobileHA","minFrameTime","promise","promiseRejectEmpty","queue","repeat","speed","sync","defaults","freeze","reset","Normalizations","NormalizationUnits","NoCacheNormalizations","Set","constructors","constructorCache","Map","dataName","Data","data","ownerDocument","defaultView","types","index","newData","count","computedStyle","queueList","lastAnimationList","lastFinishList","isClient","windowScrollAnchor","pageYOffset","State","isMobile","test","navigator","userAgent","isGingerbread","prefixElement","document","createElement","scrollAnchor","documentElement","body","parentNode","scrollPropertyLeft","scrollPropertyTop","isTicking","first","last","firstNew","animate","animation","prev","_prev","_next","queueName","dequeue","skip","freeAnimationCall","next","options","SequencesObject","callComplete","activeCall","elements","setTimeout","completeCall","isLoop","isRepeat","isStopped","_flags","repeatAgain","timeStart","ellapsedTime","_completed","_total","resolver","_resolver","registerNormalization","indexOf","nextArg","has","get","set","unit","units","hasNormalization","getNormalizationUnit","includes","getNormalization","propertyName","setPropertyValue","propertyValue","noCache","Velocity","debug","info","removeNestedCalc","tokens","split","depth","token","join","camelCase","fixed","$","letter","toUpperCase","rxColor6","rxColor3","rxColorName","rxRGB","rxSpaces","ColorNames","makeRGBA","ignore","r","g","fixColors","$0","$1","$2","augmentDimension","wantInner","isBorderBox","getPropertyValue","sides","fields","augment","field","getWidthHeight","getBoundingClientRect","computePropertyValue","getComputedStyle","computedValue","String","style","position","topLeft","skipCache","rxHex","commands","function","elementArrayIndex","tween","number","string","expandProperties","properties","tweens","create","valueData","log","arr1","arr2","end","start","explodeTween","rxToken","rxNumber","findPattern","parts","partsLength","indexes","numbers","part","match","sequence","pattern","addString","text","returnStringType","isDisplay","isVisibility","more","bits","isUnitless","hasNumbers","digits","change","changeOrUnit","index2","splice","firstLetter","patternCalc","isComplex","isMaths","bit","substring","inRGB","starting","startNumbers","percent","validateTweens","JSON","stringify","beginCall","progressCall","progress","tweenValue","lastTick","asyncCallbacks","progressed","clear","completed","FRAME_TIME","performance","perf","nowOffset","timing","navigationStart","rAFProxy","rAFShim","requestAnimationFrame","ticking","worker","workerFn","interval","onmessage","e","setInterval","postMessage","clearInterval","Worker","URL","createObjectURL","Blob","tick","hidden","addEventListener","timestamp","timeCurrent","deltaTime","defaultSpeed","defaultEasing","defaultDuration","nextCall","flags","_ready","_started","_first","activeEasing","millisecondsEllapsed","mock","reverse","currentValue","easingComplete","best","j","tweenFrom","tweenTo","rawPercent","tweenPercent","result","size","checkAnimationShouldBeFinished","defaultQueue","endValues","finish","promiseHandler","finishAll","animations","then","animationFlags","isExpanded","isReady","isStarted","isPaused","isSync","isReverse","option","action","key","flag","isPercentComplete","checkAnimation","pauseResume","propertyAction","prop","res","_rejecter","SyntaxError","checkAnimationShouldBeStopped","stop","tweenAction","requireForcefeeding","Error","fakeAnimation","singleResult","maybeSequence","expandSequence","propertyTween","tweenEasing","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","registerBackIn","amount","pow","registerBackOut","registerBackInOut","easeOutBouncePercent","easeInBouncePercent","easeInBounce","easeOutBounce","easeInOutBounce","PI2","registerElasticIn","amplitude","period","sin","asin","registerElasticOut","registerElasticInOut","s","atStart","during","atEnd","getDimension","inlineRx","listItemRx","tableRowRx","tableRx","tableRowGroupRx","display","nodeName","clientWidth","scrollWidth","clientHeight","scrollHeight","scroll","direction","client","scrollValue","rxAddPx","getSetPrefixed","unprefixed","getSetStyle","rxVendors","addUnit","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","sequenceList","keys","percentages","orderedPercents","sort","a1","b1","stepProperties","realSequence","originalProperty","globalPromise","Promise","_a","noPromiseOption","patchPromise","promiseObject","bind","catch","finally","args0","syntacticSugar","p","names","argumentIndex","propertiesMap","optionsMap","rejecter","isAction","opts","o","resolve","reject","optionPromiseRejectEmpty","actionArgs","_promise","hasValidDuration","validDuration","drag","stagger","visibility","optionsBegin","optionsComplete","optionsProgress","optionsSync","offset","rootAnimation","lastAnimation","optionCallback","patch","global"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA;;;AAGA,WAAgBA,UAAUC;EACzB,WAAOA,aAAa,IAAb,IAAqBA,aAAa,KAAzC;EACA;AAED,EAaA;;;AAGA,WAAgBC,WAAWD;EAC1B,WAAOE,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BL,QAA/B,MAA6C,mBAApD;EACA;EAED;;;AAGA,W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