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AdD,EAAkB,EAAID,EAE/BG,EAAuB,GAAdF,EAAkB,EAAID,EAEnC59E,KAAKi7E,eAAe96D,aAAa,eAAgB29D,EAAS,IAAMC,GAKhE,IAAIC,EAAuD,GAA5Ch+E,KAAKy7C,cAAcrI,eAAe,GAAG/rC,EAAEL,EAAS,OAAS,YAExEhH,KAAKi7E,eAAe96D,aAAa,WAAY69D,KAIjDrnE,iBAAiB,SAAUyhD,gBAC3BzhD,iBAAiB,OAAQ0iD,gBACzB1iD,iBAAiB,MAAO65C,aAExB/zB,eAAeE,iBAAiB,KAAMG,cACtCL,eAAeE,iBAAiB,KAAMI,wBACtCN,eAAeE,iBAAiB,KAAMgE,kBACtClE,eAAeE,iBAAiB,KAAMiE,sBACtCnE,eAAeE,iBAAiB,KAAM4G,gBACtC9G,eAAeE,iBAAiB,KAAMkK,oBAEtCv+B,qBAAqB67D,aACrB37D,wBAAwB2jE,cACxB6M,eACAM,aAEAt9B,eAAe,GAAI89B,eAAe,GAClC99B,eAAe,GAAIi+B,eAAe,GAClCj+B,eAAe,GAAIk+B,iBAAiB,GACpCl+B,eAAe,GAAIo+B,kBAAkB,GACrCp+B,eAAe,GAAIy+B,oBAAoB,GACvCz+B,eAAe,GAAI++B,qBAAqB,GACxC/+B,eAAe,GAAIkhC,iBAAiB,GACpClhC,eAAe,GAAIohC,uBAAuB,GAEnCriD,QApsmBwDkjD,OAAOzhD,QAAU7+B","sources":["webpack://_N_E/./node_modules/lottie-web/build/player/lottie.js"],"sourcesContent":["(typeof navigator !== \"undefined\") && (function (global, factory) {\r\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\r\n typeof define === 'function' && define.amd ? define(factory) :\r\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lottie = factory());\r\n})(this, (function () { 'use strict';\r\n\r\n var svgNS = 'http://www.w3.org/2000/svg';\r\n var locationHref = '';\r\n var _useWebWorker = false;\r\n var initialDefaultFrame = -999999;\r\n\r\n var setWebWorker = function setWebWorker(flag) {\r\n _useWebWorker = !!flag;\r\n };\r\n\r\n var getWebWorker = function getWebWorker() {\r\n return _useWebWorker;\r\n };\r\n\r\n var setLocationHref = function setLocationHref(value) {\r\n locationHref = value;\r\n };\r\n\r\n var getLocationHref = function getLocationHref() {\r\n return locationHref;\r\n };\r\n\r\n function createTag(type) {\r\n // return {appendChild:function(){},setAttribute:function(){},style:{}}\r\n return document.createElement(type);\r\n }\r\n\r\n function extendPrototype(sources, destination) {\r\n var i;\r\n var len = sources.length;\r\n var sourcePrototype;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n sourcePrototype = sources[i].prototype;\r\n\r\n for (var attr in sourcePrototype) {\r\n if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];\r\n }\r\n }\r\n }\r\n\r\n function getDescriptor(object, prop) {\r\n return Object.getOwnPropertyDescriptor(object, prop);\r\n }\r\n\r\n function createProxyFunction(prototype) {\r\n function ProxyFunction() {}\r\n\r\n ProxyFunction.prototype = prototype;\r\n return ProxyFunction;\r\n }\r\n\r\n // import Howl from '../../3rd_party/howler';\r\n var audioControllerFactory = function () {\r\n function AudioController(audioFactory) {\r\n this.audios = [];\r\n this.audioFactory = audioFactory;\r\n this._volume = 1;\r\n this._isMuted = false;\r\n }\r\n\r\n AudioController.prototype = {\r\n addAudio: function addAudio(audio) {\r\n this.audios.push(audio);\r\n },\r\n pause: function pause() {\r\n var i;\r\n var len = this.audios.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.audios[i].pause();\r\n }\r\n },\r\n resume: function resume() {\r\n var i;\r\n var len = this.audios.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.audios[i].resume();\r\n }\r\n },\r\n setRate: function setRate(rateValue) {\r\n var i;\r\n var len = this.audios.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.audios[i].setRate(rateValue);\r\n }\r\n },\r\n createAudio: function createAudio(assetPath) {\r\n if (this.audioFactory) {\r\n return this.audioFactory(assetPath);\r\n }\r\n\r\n if (window.Howl) {\r\n return new window.Howl({\r\n src: [assetPath]\r\n });\r\n }\r\n\r\n return {\r\n isPlaying: false,\r\n play: function play() {\r\n this.isPlaying = true;\r\n },\r\n seek: function seek() {\r\n this.isPlaying = false;\r\n },\r\n playing: function playing() {},\r\n rate: function rate() {},\r\n setVolume: function setVolume() {}\r\n };\r\n },\r\n setAudioFactory: function setAudioFactory(audioFactory) {\r\n this.audioFactory = audioFactory;\r\n },\r\n setVolume: function setVolume(value) {\r\n this._volume = value;\r\n\r\n this._updateVolume();\r\n },\r\n mute: function mute() {\r\n this._isMuted = true;\r\n\r\n this._updateVolume();\r\n },\r\n unmute: function unmute() {\r\n this._isMuted = false;\r\n\r\n this._updateVolume();\r\n },\r\n getVolume: function getVolume() {\r\n return this._volume;\r\n },\r\n _updateVolume: function _updateVolume() {\r\n var i;\r\n var len = this.audios.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));\r\n }\r\n }\r\n };\r\n return function () {\r\n return new AudioController();\r\n };\r\n }();\r\n\r\n var createTypedArray = function () {\r\n function createRegularArray(type, len) {\r\n var i = 0;\r\n var arr = [];\r\n var value;\r\n\r\n switch (type) {\r\n case 'int16':\r\n case 'uint8c':\r\n value = 1;\r\n break;\r\n\r\n default:\r\n value = 1.1;\r\n break;\r\n }\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr.push(value);\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n function createTypedArrayFactory(type, len) {\r\n if (type === 'float32') {\r\n return new Float32Array(len);\r\n }\r\n\r\n if (type === 'int16') {\r\n return new Int16Array(len);\r\n }\r\n\r\n if (type === 'uint8c') {\r\n return new Uint8ClampedArray(len);\r\n }\r\n\r\n return createRegularArray(type, len);\r\n }\r\n\r\n if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {\r\n return createTypedArrayFactory;\r\n }\r\n\r\n return createRegularArray;\r\n }();\r\n\r\n function createSizedArray(len) {\r\n return Array.apply(null, {\r\n length: len\r\n });\r\n }\r\n\r\n function _typeof$6(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$6 = function _typeof(obj) { return typeof obj; }; } else { _typeof$6 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$6(obj); }\r\n var subframeEnabled = true;\r\n var expressionsPlugin = null;\r\n var expressionsInterfaces = null;\r\n var idPrefix$1 = '';\r\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\r\n var _shouldRoundValues = false;\r\n var bmPow = Math.pow;\r\n var bmSqrt = Math.sqrt;\r\n var bmFloor = Math.floor;\r\n var bmMax = Math.max;\r\n var bmMin = Math.min;\r\n var BMMath = {};\r\n\r\n (function () {\r\n var propertyNames = ['abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'atan2', 'ceil', 'cbrt', 'expm1', 'clz32', 'cos', 'cosh', 'exp', 'floor', 'fround', 'hypot', 'imul', 'log', 'log1p', 'log2', 'log10', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc', 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2'];\r\n var i;\r\n var len = propertyNames.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n BMMath[propertyNames[i]] = Math[propertyNames[i]];\r\n }\r\n })();\r\n\r\n function ProjectInterface$1() {\r\n return {};\r\n }\r\n\r\n BMMath.random = Math.random;\r\n\r\n BMMath.abs = function (val) {\r\n var tOfVal = _typeof$6(val);\r\n\r\n if (tOfVal === 'object' && val.length) {\r\n var absArr = createSizedArray(val.length);\r\n var i;\r\n var len = val.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n absArr[i] = Math.abs(val[i]);\r\n }\r\n\r\n return absArr;\r\n }\r\n\r\n return Math.abs(val);\r\n };\r\n\r\n var defaultCurveSegments = 150;\r\n var degToRads = Math.PI / 180;\r\n var roundCorner = 0.5519;\r\n\r\n function roundValues(flag) {\r\n _shouldRoundValues = !!flag;\r\n }\r\n\r\n function bmRnd(value) {\r\n if (_shouldRoundValues) {\r\n return Math.round(value);\r\n }\r\n\r\n return value;\r\n }\r\n\r\n function styleDiv(element) {\r\n element.style.position = 'absolute';\r\n element.style.top = 0;\r\n element.style.left = 0;\r\n element.style.display = 'block';\r\n element.style.transformOrigin = '0 0';\r\n element.style.webkitTransformOrigin = '0 0';\r\n element.style.backfaceVisibility = 'visible';\r\n element.style.webkitBackfaceVisibility = 'visible';\r\n element.style.transformStyle = 'preserve-3d';\r\n element.style.webkitTransformStyle = 'preserve-3d';\r\n element.style.mozTransformStyle = 'preserve-3d';\r\n }\r\n\r\n function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {\r\n this.type = type;\r\n this.currentTime = currentTime;\r\n this.totalTime = totalTime;\r\n this.direction = frameMultiplier < 0 ? -1 : 1;\r\n }\r\n\r\n function BMCompleteEvent(type, frameMultiplier) {\r\n this.type = type;\r\n this.direction = frameMultiplier < 0 ? -1 : 1;\r\n }\r\n\r\n function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {\r\n this.type = type;\r\n this.currentLoop = currentLoop;\r\n this.totalLoops = totalLoops;\r\n this.direction = frameMultiplier < 0 ? -1 : 1;\r\n }\r\n\r\n function BMSegmentStartEvent(type, firstFrame, totalFrames) {\r\n this.type = type;\r\n this.firstFrame = firstFrame;\r\n this.totalFrames = totalFrames;\r\n }\r\n\r\n function BMDestroyEvent(type, target) {\r\n this.type = type;\r\n this.target = target;\r\n }\r\n\r\n function BMRenderFrameErrorEvent(nativeError, currentTime) {\r\n this.type = 'renderFrameError';\r\n this.nativeError = nativeError;\r\n this.currentTime = currentTime;\r\n }\r\n\r\n function BMConfigErrorEvent(nativeError) {\r\n this.type = 'configError';\r\n this.nativeError = nativeError;\r\n }\r\n\r\n function BMAnimationConfigErrorEvent(type, nativeError) {\r\n this.type = type;\r\n this.nativeError = nativeError;\r\n }\r\n\r\n var createElementID = function () {\r\n var _count = 0;\r\n return function createID() {\r\n _count += 1;\r\n return idPrefix$1 + '__lottie_element_' + _count;\r\n };\r\n }();\r\n\r\n function HSVtoRGB(h, s, v) {\r\n var r;\r\n var g;\r\n var b;\r\n var i;\r\n var f;\r\n var p;\r\n var q;\r\n var t;\r\n i = Math.floor(h * 6);\r\n f = h * 6 - i;\r\n p = v * (1 - s);\r\n q = v * (1 - f * s);\r\n t = v * (1 - (1 - f) * s);\r\n\r\n switch (i % 6) {\r\n case 0:\r\n r = v;\r\n g = t;\r\n b = p;\r\n break;\r\n\r\n case 1:\r\n r = q;\r\n g = v;\r\n b = p;\r\n break;\r\n\r\n case 2:\r\n r = p;\r\n g = v;\r\n b = t;\r\n break;\r\n\r\n case 3:\r\n r = p;\r\n g = q;\r\n b = v;\r\n break;\r\n\r\n case 4:\r\n r = t;\r\n g = p;\r\n b = v;\r\n break;\r\n\r\n case 5:\r\n r = v;\r\n g = p;\r\n b = q;\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return [r, g, b];\r\n }\r\n\r\n function RGBtoHSV(r, g, b) {\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var d = max - min;\r\n var h;\r\n var s = max === 0 ? 0 : d / max;\r\n var v = max / 255;\r\n\r\n switch (max) {\r\n case min:\r\n h = 0;\r\n break;\r\n\r\n case r:\r\n h = g - b + d * (g < b ? 6 : 0);\r\n h /= 6 * d;\r\n break;\r\n\r\n case g:\r\n h = b - r + d * 2;\r\n h /= 6 * d;\r\n break;\r\n\r\n case b:\r\n h = r - g + d * 4;\r\n h /= 6 * d;\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return [h, s, v];\r\n }\r\n\r\n function addSaturationToRGB(color, offset) {\r\n var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);\r\n hsv[1] += offset;\r\n\r\n if (hsv[1] > 1) {\r\n hsv[1] = 1;\r\n } else if (hsv[1] <= 0) {\r\n hsv[1] = 0;\r\n }\r\n\r\n return HSVtoRGB(hsv[0], hsv[1], hsv[2]);\r\n }\r\n\r\n function addBrightnessToRGB(color, offset) {\r\n var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);\r\n hsv[2] += offset;\r\n\r\n if (hsv[2] > 1) {\r\n hsv[2] = 1;\r\n } else if (hsv[2] < 0) {\r\n hsv[2] = 0;\r\n }\r\n\r\n return HSVtoRGB(hsv[0], hsv[1], hsv[2]);\r\n }\r\n\r\n function addHueToRGB(color, offset) {\r\n var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);\r\n hsv[0] += offset / 360;\r\n\r\n if (hsv[0] > 1) {\r\n hsv[0] -= 1;\r\n } else if (hsv[0] < 0) {\r\n hsv[0] += 1;\r\n }\r\n\r\n return HSVtoRGB(hsv[0], hsv[1], hsv[2]);\r\n }\r\n\r\n var rgbToHex = function () {\r\n var colorMap = [];\r\n var i;\r\n var hex;\r\n\r\n for (i = 0; i < 256; i += 1) {\r\n hex = i.toString(16);\r\n colorMap[i] = hex.length === 1 ? '0' + hex : hex;\r\n }\r\n\r\n return function (r, g, b) {\r\n if (r < 0) {\r\n r = 0;\r\n }\r\n\r\n if (g < 0) {\r\n g = 0;\r\n }\r\n\r\n if (b < 0) {\r\n b = 0;\r\n }\r\n\r\n return '#' + colorMap[r] + colorMap[g] + colorMap[b];\r\n };\r\n }();\r\n\r\n var setSubframeEnabled = function setSubframeEnabled(flag) {\r\n subframeEnabled = !!flag;\r\n };\r\n\r\n var getSubframeEnabled = function getSubframeEnabled() {\r\n return subframeEnabled;\r\n };\r\n\r\n var setExpressionsPlugin = function setExpressionsPlugin(value) {\r\n expressionsPlugin = value;\r\n };\r\n\r\n var getExpressionsPlugin = function getExpressionsPlugin() {\r\n return expressionsPlugin;\r\n };\r\n\r\n var setExpressionInterfaces = function setExpressionInterfaces(value) {\r\n expressionsInterfaces = value;\r\n };\r\n\r\n var getExpressionInterfaces = function getExpressionInterfaces() {\r\n return expressionsInterfaces;\r\n };\r\n\r\n var setDefaultCurveSegments = function setDefaultCurveSegments(value) {\r\n defaultCurveSegments = value;\r\n };\r\n\r\n var getDefaultCurveSegments = function getDefaultCurveSegments() {\r\n return defaultCurveSegments;\r\n };\r\n\r\n var setIdPrefix = function setIdPrefix(value) {\r\n idPrefix$1 = value;\r\n };\r\n\r\n var getIdPrefix = function getIdPrefix() {\r\n return idPrefix$1;\r\n };\r\n\r\n function createNS(type) {\r\n // return {appendChild:function(){},setAttribute:function(){},style:{}}\r\n return document.createElementNS(svgNS, type);\r\n }\r\n\r\n function _typeof$5(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$5 = function _typeof(obj) { return typeof obj; }; } else { _typeof$5 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$5(obj); }\r\n\r\n var dataManager = function () {\r\n var _counterId = 1;\r\n var processes = [];\r\n var workerFn;\r\n var workerInstance;\r\n var workerProxy = {\r\n onmessage: function onmessage() {},\r\n postMessage: function postMessage(path) {\r\n workerFn({\r\n data: path\r\n });\r\n }\r\n };\r\n var _workerSelf = {\r\n postMessage: function postMessage(data) {\r\n workerProxy.onmessage({\r\n data: data\r\n });\r\n }\r\n };\r\n\r\n function createWorker(fn) {\r\n if (window.Worker && window.Blob && getWebWorker()) {\r\n var blob = new Blob(['var _workerSelf = self; self.onmessage = ', fn.toString()], {\r\n type: 'text/javascript'\r\n }); // var blob = new Blob(['self.onmessage = ', fn.toString()], { type: 'text/javascript' });\r\n\r\n var url = URL.createObjectURL(blob);\r\n return new Worker(url);\r\n }\r\n\r\n workerFn = fn;\r\n return workerProxy;\r\n }\r\n\r\n function setupWorker() {\r\n if (!workerInstance) {\r\n workerInstance = createWorker(function workerStart(e) {\r\n function dataFunctionManager() {\r\n function completeLayers(layers, comps) {\r\n var layerData;\r\n var i;\r\n var len = layers.length;\r\n var j;\r\n var jLen;\r\n var k;\r\n var kLen;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n layerData = layers[i];\r\n\r\n if ('ks' in layerData && !layerData.completed) {\r\n layerData.completed = true;\r\n\r\n if (layerData.hasMask) {\r\n var maskProps = layerData.masksProperties;\r\n jLen = maskProps.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (maskProps[j].pt.k.i) {\r\n convertPathsToAbsoluteValues(maskProps[j].pt.k);\r\n } else {\r\n kLen = maskProps[j].pt.k.length;\r\n\r\n for (k = 0; k < kLen; k += 1) {\r\n if (maskProps[j].pt.k[k].s) {\r\n convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);\r\n }\r\n\r\n if (maskProps[j].pt.k[k].e) {\r\n convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (layerData.ty === 0) {\r\n layerData.layers = findCompLayers(layerData.refId, comps);\r\n completeLayers(layerData.layers, comps);\r\n } else if (layerData.ty === 4) {\r\n completeShapes(layerData.shapes);\r\n } else if (layerData.ty === 5) {\r\n completeText(layerData);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function completeChars(chars, assets) {\r\n if (chars) {\r\n var i = 0;\r\n var len = chars.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (chars[i].t === 1) {\r\n // var compData = findComp(chars[i].data.refId, assets);\r\n chars[i].data.layers = findCompLayers(chars[i].data.refId, assets); // chars[i].data.ip = 0;\r\n // chars[i].data.op = 99999;\r\n // chars[i].data.st = 0;\r\n // chars[i].data.sr = 1;\r\n // chars[i].w = compData.w;\r\n // chars[i].data.ks = {\r\n // a: { k: [0, 0, 0], a: 0 },\r\n // p: { k: [0, -compData.h, 0], a: 0 },\r\n // r: { k: 0, a: 0 },\r\n // s: { k: [100, 100], a: 0 },\r\n // o: { k: 100, a: 0 },\r\n // };\r\n\r\n completeLayers(chars[i].data.layers, assets);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function findComp(id, comps) {\r\n var i = 0;\r\n var len = comps.length;\r\n\r\n while (i < len) {\r\n if (comps[i].id === id) {\r\n return comps[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function findCompLayers(id, comps) {\r\n var comp = findComp(id, comps);\r\n\r\n if (comp) {\r\n if (!comp.layers.__used) {\r\n comp.layers.__used = true;\r\n return comp.layers;\r\n }\r\n\r\n return JSON.parse(JSON.stringify(comp.layers));\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function completeShapes(arr) {\r\n var i;\r\n var len = arr.length;\r\n var j;\r\n var jLen;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (arr[i].ty === 'sh') {\r\n if (arr[i].ks.k.i) {\r\n convertPathsToAbsoluteValues(arr[i].ks.k);\r\n } else {\r\n jLen = arr[i].ks.k.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (arr[i].ks.k[j].s) {\r\n convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);\r\n }\r\n\r\n if (arr[i].ks.k[j].e) {\r\n convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);\r\n }\r\n }\r\n }\r\n } else if (arr[i].ty === 'gr') {\r\n completeShapes(arr[i].it);\r\n }\r\n }\r\n }\r\n\r\n function convertPathsToAbsoluteValues(path) {\r\n var i;\r\n var len = path.i.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n path.i[i][0] += path.v[i][0];\r\n path.i[i][1] += path.v[i][1];\r\n path.o[i][0] += path.v[i][0];\r\n path.o[i][1] += path.v[i][1];\r\n }\r\n }\r\n\r\n function checkVersion(minimum, animVersionString) {\r\n var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];\r\n\r\n if (minimum[0] > animVersion[0]) {\r\n return true;\r\n }\r\n\r\n if (animVersion[0] > minimum[0]) {\r\n return false;\r\n }\r\n\r\n if (minimum[1] > animVersion[1]) {\r\n return true;\r\n }\r\n\r\n if (animVersion[1] > minimum[1]) {\r\n return false;\r\n }\r\n\r\n if (minimum[2] > animVersion[2]) {\r\n return true;\r\n }\r\n\r\n if (animVersion[2] > minimum[2]) {\r\n return false;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var checkText = function () {\r\n var minimumVersion = [4, 4, 14];\r\n\r\n function updateTextLayer(textLayer) {\r\n var documentData = textLayer.t.d;\r\n textLayer.t.d = {\r\n k: [{\r\n s: documentData,\r\n t: 0\r\n }]\r\n };\r\n }\r\n\r\n function iterateLayers(layers) {\r\n var i;\r\n var len = layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (layers[i].ty === 5) {\r\n updateTextLayer(layers[i]);\r\n }\r\n }\r\n }\r\n\r\n return function (animationData) {\r\n if (checkVersion(minimumVersion, animationData.v)) {\r\n iterateLayers(animationData.layers);\r\n\r\n if (animationData.assets) {\r\n var i;\r\n var len = animationData.assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (animationData.assets[i].layers) {\r\n iterateLayers(animationData.assets[i].layers);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }();\r\n\r\n var checkChars = function () {\r\n var minimumVersion = [4, 7, 99];\r\n return function (animationData) {\r\n if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {\r\n var i;\r\n var len = animationData.chars.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n var charData = animationData.chars[i];\r\n\r\n if (charData.data && charData.data.shapes) {\r\n completeShapes(charData.data.shapes);\r\n charData.data.ip = 0;\r\n charData.data.op = 99999;\r\n charData.data.st = 0;\r\n charData.data.sr = 1;\r\n charData.data.ks = {\r\n p: {\r\n k: [0, 0],\r\n a: 0\r\n },\r\n s: {\r\n k: [100, 100],\r\n a: 0\r\n },\r\n a: {\r\n k: [0, 0],\r\n a: 0\r\n },\r\n r: {\r\n k: 0,\r\n a: 0\r\n },\r\n o: {\r\n k: 100,\r\n a: 0\r\n }\r\n };\r\n\r\n if (!animationData.chars[i].t) {\r\n charData.data.shapes.push({\r\n ty: 'no'\r\n });\r\n charData.data.shapes[0].it.push({\r\n p: {\r\n k: [0, 0],\r\n a: 0\r\n },\r\n s: {\r\n k: [100, 100],\r\n a: 0\r\n },\r\n a: {\r\n k: [0, 0],\r\n a: 0\r\n },\r\n r: {\r\n k: 0,\r\n a: 0\r\n },\r\n o: {\r\n k: 100,\r\n a: 0\r\n },\r\n sk: {\r\n k: 0,\r\n a: 0\r\n },\r\n sa: {\r\n k: 0,\r\n a: 0\r\n },\r\n ty: 'tr'\r\n });\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }();\r\n\r\n var checkPathProperties = function () {\r\n var minimumVersion = [5, 7, 15];\r\n\r\n function updateTextLayer(textLayer) {\r\n var pathData = textLayer.t.p;\r\n\r\n if (typeof pathData.a === 'number') {\r\n pathData.a = {\r\n a: 0,\r\n k: pathData.a\r\n };\r\n }\r\n\r\n if (typeof pathData.p === 'number') {\r\n pathData.p = {\r\n a: 0,\r\n k: pathData.p\r\n };\r\n }\r\n\r\n if (typeof pathData.r === 'number') {\r\n pathData.r = {\r\n a: 0,\r\n k: pathData.r\r\n };\r\n }\r\n }\r\n\r\n function iterateLayers(layers) {\r\n var i;\r\n var len = layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (layers[i].ty === 5) {\r\n updateTextLayer(layers[i]);\r\n }\r\n }\r\n }\r\n\r\n return function (animationData) {\r\n if (checkVersion(minimumVersion, animationData.v)) {\r\n iterateLayers(animationData.layers);\r\n\r\n if (animationData.assets) {\r\n var i;\r\n var len = animationData.assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (animationData.assets[i].layers) {\r\n iterateLayers(animationData.assets[i].layers);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }();\r\n\r\n var checkColors = function () {\r\n var minimumVersion = [4, 1, 9];\r\n\r\n function iterateShapes(shapes) {\r\n var i;\r\n var len = shapes.length;\r\n var j;\r\n var jLen;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (shapes[i].ty === 'gr') {\r\n iterateShapes(shapes[i].it);\r\n } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {\r\n if (shapes[i].c.k && shapes[i].c.k[0].i) {\r\n jLen = shapes[i].c.k.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (shapes[i].c.k[j].s) {\r\n shapes[i].c.k[j].s[0] /= 255;\r\n shapes[i].c.k[j].s[1] /= 255;\r\n shapes[i].c.k[j].s[2] /= 255;\r\n shapes[i].c.k[j].s[3] /= 255;\r\n }\r\n\r\n if (shapes[i].c.k[j].e) {\r\n shapes[i].c.k[j].e[0] /= 255;\r\n shapes[i].c.k[j].e[1] /= 255;\r\n shapes[i].c.k[j].e[2] /= 255;\r\n shapes[i].c.k[j].e[3] /= 255;\r\n }\r\n }\r\n } else {\r\n shapes[i].c.k[0] /= 255;\r\n shapes[i].c.k[1] /= 255;\r\n shapes[i].c.k[2] /= 255;\r\n shapes[i].c.k[3] /= 255;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function iterateLayers(layers) {\r\n var i;\r\n var len = layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (layers[i].ty === 4) {\r\n iterateShapes(layers[i].shapes);\r\n }\r\n }\r\n }\r\n\r\n return function (animationData) {\r\n if (checkVersion(minimumVersion, animationData.v)) {\r\n iterateLayers(animationData.layers);\r\n\r\n if (animationData.assets) {\r\n var i;\r\n var len = animationData.assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (animationData.assets[i].layers) {\r\n iterateLayers(animationData.assets[i].layers);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }();\r\n\r\n var checkShapes = function () {\r\n var minimumVersion = [4, 4, 18];\r\n\r\n function completeClosingShapes(arr) {\r\n var i;\r\n var len = arr.length;\r\n var j;\r\n var jLen;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (arr[i].ty === 'sh') {\r\n if (arr[i].ks.k.i) {\r\n arr[i].ks.k.c = arr[i].closed;\r\n } else {\r\n jLen = arr[i].ks.k.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (arr[i].ks.k[j].s) {\r\n arr[i].ks.k[j].s[0].c = arr[i].closed;\r\n }\r\n\r\n if (arr[i].ks.k[j].e) {\r\n arr[i].ks.k[j].e[0].c = arr[i].closed;\r\n }\r\n }\r\n }\r\n } else if (arr[i].ty === 'gr') {\r\n completeClosingShapes(arr[i].it);\r\n }\r\n }\r\n }\r\n\r\n function iterateLayers(layers) {\r\n var layerData;\r\n var i;\r\n var len = layers.length;\r\n var j;\r\n var jLen;\r\n var k;\r\n var kLen;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n layerData = layers[i];\r\n\r\n if (layerData.hasMask) {\r\n var maskProps = layerData.masksProperties;\r\n jLen = maskProps.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (maskProps[j].pt.k.i) {\r\n maskProps[j].pt.k.c = maskProps[j].cl;\r\n } else {\r\n kLen = maskProps[j].pt.k.length;\r\n\r\n for (k = 0; k < kLen; k += 1) {\r\n if (maskProps[j].pt.k[k].s) {\r\n maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;\r\n }\r\n\r\n if (maskProps[j].pt.k[k].e) {\r\n maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (layerData.ty === 4) {\r\n completeClosingShapes(layerData.shapes);\r\n }\r\n }\r\n }\r\n\r\n return function (animationData) {\r\n if (checkVersion(minimumVersion, animationData.v)) {\r\n iterateLayers(animationData.layers);\r\n\r\n if (animationData.assets) {\r\n var i;\r\n var len = animationData.assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (animationData.assets[i].layers) {\r\n iterateLayers(animationData.assets[i].layers);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }();\r\n\r\n function completeData(animationData) {\r\n if (animationData.__complete) {\r\n return;\r\n }\r\n\r\n checkColors(animationData);\r\n checkText(animationData);\r\n checkChars(animationData);\r\n checkPathProperties(animationData);\r\n checkShapes(animationData);\r\n completeLayers(animationData.layers, animationData.assets);\r\n completeChars(animationData.chars, animationData.assets);\r\n animationData.__complete = true;\r\n }\r\n\r\n function completeText(data) {\r\n if (data.t.a.length === 0 && !('m' in data.t.p)) {// data.singleShape = true;\r\n }\r\n }\r\n\r\n var moduleOb = {};\r\n moduleOb.completeData = completeData;\r\n moduleOb.checkColors = checkColors;\r\n moduleOb.checkChars = checkChars;\r\n moduleOb.checkPathProperties = checkPathProperties;\r\n moduleOb.checkShapes = checkShapes;\r\n moduleOb.completeLayers = completeLayers;\r\n return moduleOb;\r\n }\r\n\r\n if (!_workerSelf.dataManager) {\r\n _workerSelf.dataManager = dataFunctionManager();\r\n }\r\n\r\n if (!_workerSelf.assetLoader) {\r\n _workerSelf.assetLoader = function () {\r\n function formatResponse(xhr) {\r\n // using typeof doubles the time of execution of this method,\r\n // so if available, it's better to use the header to validate the type\r\n var contentTypeHeader = xhr.getResponseHeader('content-type');\r\n\r\n if (contentTypeHeader && xhr.responseType === 'json' && contentTypeHeader.indexOf('json') !== -1) {\r\n return xhr.response;\r\n }\r\n\r\n if (xhr.response && _typeof$5(xhr.response) === 'object') {\r\n return xhr.response;\r\n }\r\n\r\n if (xhr.response && typeof xhr.response === 'string') {\r\n return JSON.parse(xhr.response);\r\n }\r\n\r\n if (xhr.responseText) {\r\n return JSON.parse(xhr.responseText);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function loadAsset(path, fullPath, callback, errorCallback) {\r\n var response;\r\n var xhr = new XMLHttpRequest(); // set responseType after calling open or IE will break.\r\n\r\n try {\r\n // This crashes on Android WebView prior to KitKat\r\n xhr.responseType = 'json';\r\n } catch (err) {} // eslint-disable-line no-empty\r\n\r\n\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 200) {\r\n response = formatResponse(xhr);\r\n callback(response);\r\n } else {\r\n try {\r\n response = formatResponse(xhr);\r\n callback(response);\r\n } catch (err) {\r\n if (errorCallback) {\r\n errorCallback(err);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n try {\r\n // Hack to workaround banner validation\r\n xhr.open(['G', 'E', 'T'].join(''), path, true);\r\n } catch (error) {\r\n // Hack to workaround banner validation\r\n xhr.open(['G', 'E', 'T'].join(''), fullPath + '/' + path, true);\r\n }\r\n\r\n xhr.send();\r\n }\r\n\r\n return {\r\n load: loadAsset\r\n };\r\n }();\r\n }\r\n\r\n if (e.data.type === 'loadAnimation') {\r\n _workerSelf.assetLoader.load(e.data.path, e.data.fullPath, function (data) {\r\n _workerSelf.dataManager.completeData(data);\r\n\r\n _workerSelf.postMessage({\r\n id: e.data.id,\r\n payload: data,\r\n status: 'success'\r\n });\r\n }, function () {\r\n _workerSelf.postMessage({\r\n id: e.data.id,\r\n status: 'error'\r\n });\r\n });\r\n } else if (e.data.type === 'complete') {\r\n var animation = e.data.animation;\r\n\r\n _workerSelf.dataManager.completeData(animation);\r\n\r\n _workerSelf.postMessage({\r\n id: e.data.id,\r\n payload: animation,\r\n status: 'success'\r\n });\r\n } else if (e.data.type === 'loadData') {\r\n _workerSelf.assetLoader.load(e.data.path, e.data.fullPath, function (data) {\r\n _workerSelf.postMessage({\r\n id: e.data.id,\r\n payload: data,\r\n status: 'success'\r\n });\r\n }, function () {\r\n _workerSelf.postMessage({\r\n id: e.data.id,\r\n status: 'error'\r\n });\r\n });\r\n }\r\n });\r\n\r\n workerInstance.onmessage = function (event) {\r\n var data = event.data;\r\n var id = data.id;\r\n var process = processes[id];\r\n processes[id] = null;\r\n\r\n if (data.status === 'success') {\r\n process.onComplete(data.payload);\r\n } else if (process.onError) {\r\n process.onError();\r\n }\r\n };\r\n }\r\n }\r\n\r\n function createProcess(onComplete, onError) {\r\n _counterId += 1;\r\n var id = 'processId_' + _counterId;\r\n processes[id] = {\r\n onComplete: onComplete,\r\n onError: onError\r\n };\r\n return id;\r\n }\r\n\r\n function loadAnimation(path, onComplete, onError) {\r\n setupWorker();\r\n var processId = createProcess(onComplete, onError);\r\n workerInstance.postMessage({\r\n type: 'loadAnimation',\r\n path: path,\r\n fullPath: window.location.origin + window.location.pathname,\r\n id: processId\r\n });\r\n }\r\n\r\n function loadData(path, onComplete, onError) {\r\n setupWorker();\r\n var processId = createProcess(onComplete, onError);\r\n workerInstance.postMessage({\r\n type: 'loadData',\r\n path: path,\r\n fullPath: window.location.origin + window.location.pathname,\r\n id: processId\r\n });\r\n }\r\n\r\n function completeAnimation(anim, onComplete, onError) {\r\n setupWorker();\r\n var processId = createProcess(onComplete, onError);\r\n workerInstance.postMessage({\r\n type: 'complete',\r\n animation: anim,\r\n id: processId\r\n });\r\n }\r\n\r\n return {\r\n loadAnimation: loadAnimation,\r\n loadData: loadData,\r\n completeAnimation: completeAnimation\r\n };\r\n }();\r\n\r\n var ImagePreloader = function () {\r\n var proxyImage = function () {\r\n var canvas = createTag('canvas');\r\n canvas.width = 1;\r\n canvas.height = 1;\r\n var ctx = canvas.getContext('2d');\r\n ctx.fillStyle = 'rgba(0,0,0,0)';\r\n ctx.fillRect(0, 0, 1, 1);\r\n return canvas;\r\n }();\r\n\r\n function imageLoaded() {\r\n this.loadedAssets += 1;\r\n\r\n if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) {\r\n if (this.imagesLoadedCb) {\r\n this.imagesLoadedCb(null);\r\n }\r\n }\r\n }\r\n\r\n function footageLoaded() {\r\n this.loadedFootagesCount += 1;\r\n\r\n if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) {\r\n if (this.imagesLoadedCb) {\r\n this.imagesLoadedCb(null);\r\n }\r\n }\r\n }\r\n\r\n function getAssetsPath(assetData, assetsPath, originalPath) {\r\n var path = '';\r\n\r\n if (assetData.e) {\r\n path = assetData.p;\r\n } else if (assetsPath) {\r\n var imagePath = assetData.p;\r\n\r\n if (imagePath.indexOf('images/') !== -1) {\r\n imagePath = imagePath.split('/')[1];\r\n }\r\n\r\n path = assetsPath + imagePath;\r\n } else {\r\n path = originalPath;\r\n path += assetData.u ? assetData.u : '';\r\n path += assetData.p;\r\n }\r\n\r\n return path;\r\n }\r\n\r\n function testImageLoaded(img) {\r\n var _count = 0;\r\n var intervalId = setInterval(function () {\r\n var box = img.getBBox();\r\n\r\n if (box.width || _count > 500) {\r\n this._imageLoaded();\r\n\r\n clearInterval(intervalId);\r\n }\r\n\r\n _count += 1;\r\n }.bind(this), 50);\r\n }\r\n\r\n function createImageData(assetData) {\r\n var path = getAssetsPath(assetData, this.assetsPath, this.path);\r\n var img = createNS('image');\r\n\r\n if (isSafari) {\r\n this.testImageLoaded(img);\r\n } else {\r\n img.addEventListener('load', this._imageLoaded, false);\r\n }\r\n\r\n img.addEventListener('error', function () {\r\n ob.img = proxyImage;\r\n\r\n this._imageLoaded();\r\n }.bind(this), false);\r\n img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);\r\n\r\n if (this._elementHelper.append) {\r\n this._elementHelper.append(img);\r\n } else {\r\n this._elementHelper.appendChild(img);\r\n }\r\n\r\n var ob = {\r\n img: img,\r\n assetData: assetData\r\n };\r\n return ob;\r\n }\r\n\r\n function createImgData(assetData) {\r\n var path = getAssetsPath(assetData, this.assetsPath, this.path);\r\n var img = createTag('img');\r\n img.crossOrigin = 'anonymous';\r\n img.addEventListener('load', this._imageLoaded, false);\r\n img.addEventListener('error', function () {\r\n ob.img = proxyImage;\r\n\r\n this._imageLoaded();\r\n }.bind(this), false);\r\n img.src = path;\r\n var ob = {\r\n img: img,\r\n assetData: assetData\r\n };\r\n return ob;\r\n }\r\n\r\n function createFootageData(data) {\r\n var ob = {\r\n assetData: data\r\n };\r\n var path = getAssetsPath(data, this.assetsPath, this.path);\r\n dataManager.loadData(path, function (footageData) {\r\n ob.img = footageData;\r\n\r\n this._footageLoaded();\r\n }.bind(this), function () {\r\n ob.img = {};\r\n\r\n this._footageLoaded();\r\n }.bind(this));\r\n return ob;\r\n }\r\n\r\n function loadAssets(assets, cb) {\r\n this.imagesLoadedCb = cb;\r\n var i;\r\n var len = assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!assets[i].layers) {\r\n if (!assets[i].t || assets[i].t === 'seq') {\r\n this.totalImages += 1;\r\n this.images.push(this._createImageData(assets[i]));\r\n } else if (assets[i].t === 3) {\r\n this.totalFootages += 1;\r\n this.images.push(this.createFootageData(assets[i]));\r\n }\r\n }\r\n }\r\n }\r\n\r\n function setPath(path) {\r\n this.path = path || '';\r\n }\r\n\r\n function setAssetsPath(path) {\r\n this.assetsPath = path || '';\r\n }\r\n\r\n function getAsset(assetData) {\r\n var i = 0;\r\n var len = this.images.length;\r\n\r\n while (i < len) {\r\n if (this.images[i].assetData === assetData) {\r\n return this.images[i].img;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function destroy() {\r\n this.imagesLoadedCb = null;\r\n this.images.length = 0;\r\n }\r\n\r\n function loadedImages() {\r\n return this.totalImages === this.loadedAssets;\r\n }\r\n\r\n function loadedFootages() {\r\n return this.totalFootages === this.loadedFootagesCount;\r\n }\r\n\r\n function setCacheType(type, elementHelper) {\r\n if (type === 'svg') {\r\n this._elementHelper = elementHelper;\r\n this._createImageData = this.createImageData.bind(this);\r\n } else {\r\n this._createImageData = this.createImgData.bind(this);\r\n }\r\n }\r\n\r\n function ImagePreloaderFactory() {\r\n this._imageLoaded = imageLoaded.bind(this);\r\n this._footageLoaded = footageLoaded.bind(this);\r\n this.testImageLoaded = testImageLoaded.bind(this);\r\n this.createFootageData = createFootageData.bind(this);\r\n this.assetsPath = '';\r\n this.path = '';\r\n this.totalImages = 0;\r\n this.totalFootages = 0;\r\n this.loadedAssets = 0;\r\n this.loadedFootagesCount = 0;\r\n this.imagesLoadedCb = null;\r\n this.images = [];\r\n }\r\n\r\n ImagePreloaderFactory.prototype = {\r\n loadAssets: loadAssets,\r\n setAssetsPath: setAssetsPath,\r\n setPath: setPath,\r\n loadedImages: loadedImages,\r\n loadedFootages: loadedFootages,\r\n destroy: destroy,\r\n getAsset: getAsset,\r\n createImgData: createImgData,\r\n createImageData: createImageData,\r\n imageLoaded: imageLoaded,\r\n footageLoaded: footageLoaded,\r\n setCacheType: setCacheType\r\n };\r\n return ImagePreloaderFactory;\r\n }();\r\n\r\n function BaseEvent() {}\r\n\r\n BaseEvent.prototype = {\r\n triggerEvent: function triggerEvent(eventName, args) {\r\n if (this._cbs[eventName]) {\r\n var callbacks = this._cbs[eventName];\r\n\r\n for (var i = 0; i < callbacks.length; i += 1) {\r\n callbacks[i](args);\r\n }\r\n }\r\n },\r\n addEventListener: function addEventListener(eventName, callback) {\r\n if (!this._cbs[eventName]) {\r\n this._cbs[eventName] = [];\r\n }\r\n\r\n this._cbs[eventName].push(callback);\r\n\r\n return function () {\r\n this.removeEventListener(eventName, callback);\r\n }.bind(this);\r\n },\r\n removeEventListener: function removeEventListener(eventName, callback) {\r\n if (!callback) {\r\n this._cbs[eventName] = null;\r\n } else if (this._cbs[eventName]) {\r\n var i = 0;\r\n var len = this._cbs[eventName].length;\r\n\r\n while (i < len) {\r\n if (this._cbs[eventName][i] === callback) {\r\n this._cbs[eventName].splice(i, 1);\r\n\r\n i -= 1;\r\n len -= 1;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (!this._cbs[eventName].length) {\r\n this._cbs[eventName] = null;\r\n }\r\n }\r\n }\r\n };\r\n\r\n var markerParser = function () {\r\n function parsePayloadLines(payload) {\r\n var lines = payload.split('\\r\\n');\r\n var keys = {};\r\n var line;\r\n var keysCount = 0;\r\n\r\n for (var i = 0; i < lines.length; i += 1) {\r\n line = lines[i].split(':');\r\n\r\n if (line.length === 2) {\r\n keys[line[0]] = line[1].trim();\r\n keysCount += 1;\r\n }\r\n }\r\n\r\n if (keysCount === 0) {\r\n throw new Error();\r\n }\r\n\r\n return keys;\r\n }\r\n\r\n return function (_markers) {\r\n var markers = [];\r\n\r\n for (var i = 0; i < _markers.length; i += 1) {\r\n var _marker = _markers[i];\r\n var markerData = {\r\n time: _marker.tm,\r\n duration: _marker.dr\r\n };\r\n\r\n try {\r\n markerData.payload = JSON.parse(_markers[i].cm);\r\n } catch (_) {\r\n try {\r\n markerData.payload = parsePayloadLines(_markers[i].cm);\r\n } catch (__) {\r\n markerData.payload = {\r\n name: _markers[i].cm\r\n };\r\n }\r\n }\r\n\r\n markers.push(markerData);\r\n }\r\n\r\n return markers;\r\n };\r\n }();\r\n\r\n var ProjectInterface = function () {\r\n function registerComposition(comp) {\r\n this.compositions.push(comp);\r\n }\r\n\r\n return function () {\r\n function _thisProjectFunction(name) {\r\n var i = 0;\r\n var len = this.compositions.length;\r\n\r\n while (i < len) {\r\n if (this.compositions[i].data && this.compositions[i].data.nm === name) {\r\n if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {\r\n this.compositions[i].prepareFrame(this.currentFrame);\r\n }\r\n\r\n return this.compositions[i].compInterface;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n _thisProjectFunction.compositions = [];\r\n _thisProjectFunction.currentFrame = 0;\r\n _thisProjectFunction.registerComposition = registerComposition;\r\n return _thisProjectFunction;\r\n };\r\n }();\r\n\r\n var renderers = {};\r\n\r\n var registerRenderer = function registerRenderer(key, value) {\r\n renderers[key] = value;\r\n };\r\n\r\n function getRenderer(key) {\r\n return renderers[key];\r\n }\r\n\r\n function _typeof$4(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$4 = function _typeof(obj) { return typeof obj; }; } else { _typeof$4 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$4(obj); }\r\n\r\n var AnimationItem = function AnimationItem() {\r\n this._cbs = [];\r\n this.name = '';\r\n this.path = '';\r\n this.isLoaded = false;\r\n this.currentFrame = 0;\r\n this.currentRawFrame = 0;\r\n this.firstFrame = 0;\r\n this.totalFrames = 0;\r\n this.frameRate = 0;\r\n this.frameMult = 0;\r\n this.playSpeed = 1;\r\n this.playDirection = 1;\r\n this.playCount = 0;\r\n this.animationData = {};\r\n this.assets = [];\r\n this.isPaused = true;\r\n this.autoplay = false;\r\n this.loop = true;\r\n this.renderer = null;\r\n this.animationID = createElementID();\r\n this.assetsPath = '';\r\n this.timeCompleted = 0;\r\n this.segmentPos = 0;\r\n this.isSubframeEnabled = getSubframeEnabled();\r\n this.segments = [];\r\n this._idle = true;\r\n this._completedLoop = false;\r\n this.projectInterface = ProjectInterface();\r\n this.imagePreloader = new ImagePreloader();\r\n this.audioController = audioControllerFactory();\r\n this.markers = [];\r\n this.configAnimation = this.configAnimation.bind(this);\r\n this.onSetupError = this.onSetupError.bind(this);\r\n this.onSegmentComplete = this.onSegmentComplete.bind(this);\r\n this.drawnFrameEvent = new BMEnterFrameEvent('drawnFrame', 0, 0, 0);\r\n };\r\n\r\n extendPrototype([BaseEvent], AnimationItem);\r\n\r\n AnimationItem.prototype.setParams = function (params) {\r\n if (params.wrapper || params.container) {\r\n this.wrapper = params.wrapper || params.container;\r\n }\r\n\r\n var animType = 'svg';\r\n\r\n if (params.animType) {\r\n animType = params.animType;\r\n } else if (params.renderer) {\r\n animType = params.renderer;\r\n }\r\n\r\n var RendererClass = getRenderer(animType);\r\n this.renderer = new RendererClass(this, params.rendererSettings);\r\n this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);\r\n this.renderer.setProjectInterface(this.projectInterface);\r\n this.animType = animType;\r\n\r\n if (params.loop === '' || params.loop === null || params.loop === undefined || params.loop === true) {\r\n this.loop = true;\r\n } else if (params.loop === false) {\r\n this.loop = false;\r\n } else {\r\n this.loop = parseInt(params.loop, 10);\r\n }\r\n\r\n this.autoplay = 'autoplay' in params ? params.autoplay : true;\r\n this.name = params.name ? params.name : '';\r\n this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;\r\n this.assetsPath = params.assetsPath;\r\n this.initialSegment = params.initialSegment;\r\n\r\n if (params.audioFactory) {\r\n this.audioController.setAudioFactory(params.audioFactory);\r\n }\r\n\r\n if (params.animationData) {\r\n this.setupAnimation(params.animationData);\r\n } else if (params.path) {\r\n if (params.path.lastIndexOf('\\\\') !== -1) {\r\n this.path = params.path.substr(0, params.path.lastIndexOf('\\\\') + 1);\r\n } else {\r\n this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);\r\n }\r\n\r\n this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);\r\n this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));\r\n dataManager.loadAnimation(params.path, this.configAnimation, this.onSetupError);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.onSetupError = function () {\r\n this.trigger('data_failed');\r\n };\r\n\r\n AnimationItem.prototype.setupAnimation = function (data) {\r\n dataManager.completeAnimation(data, this.configAnimation);\r\n };\r\n\r\n AnimationItem.prototype.setData = function (wrapper, animationData) {\r\n if (animationData) {\r\n if (_typeof$4(animationData) !== 'object') {\r\n animationData = JSON.parse(animationData);\r\n }\r\n }\r\n\r\n var params = {\r\n wrapper: wrapper,\r\n animationData: animationData\r\n };\r\n var wrapperAttributes = wrapper.attributes;\r\n params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-path').value : wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';\r\n params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('bm-type').value : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';\r\n var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-anim-loop').value : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-loop').value : wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';\r\n\r\n if (loop === 'false') {\r\n params.loop = false;\r\n } else if (loop === 'true') {\r\n params.loop = true;\r\n } else if (loop !== '') {\r\n params.loop = parseInt(loop, 10);\r\n }\r\n\r\n var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-anim-autoplay').value : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-autoplay').value : wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;\r\n params.autoplay = autoplay !== 'false';\r\n params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-name').value : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value : '';\r\n var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-anim-prerender').value : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary\r\n ? wrapperAttributes.getNamedItem('data-bm-prerender').value : wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';\r\n\r\n if (prerender === 'false') {\r\n params.prerender = false;\r\n }\r\n\r\n this.setParams(params);\r\n };\r\n\r\n AnimationItem.prototype.includeLayers = function (data) {\r\n if (data.op > this.animationData.op) {\r\n this.animationData.op = data.op;\r\n this.totalFrames = Math.floor(data.op - this.animationData.ip);\r\n }\r\n\r\n var layers = this.animationData.layers;\r\n var i;\r\n var len = layers.length;\r\n var newLayers = data.layers;\r\n var j;\r\n var jLen = newLayers.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n i = 0;\r\n\r\n while (i < len) {\r\n if (layers[i].id === newLayers[j].id) {\r\n layers[i] = newLayers[j];\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n }\r\n\r\n if (data.chars || data.fonts) {\r\n this.renderer.globalData.fontManager.addChars(data.chars);\r\n this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);\r\n }\r\n\r\n if (data.assets) {\r\n len = data.assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.animationData.assets.push(data.assets[i]);\r\n }\r\n }\r\n\r\n this.animationData.__complete = false;\r\n dataManager.completeAnimation(this.animationData, this.onSegmentComplete);\r\n };\r\n\r\n AnimationItem.prototype.onSegmentComplete = function (data) {\r\n this.animationData = data;\r\n var expressionsPlugin = getExpressionsPlugin();\r\n\r\n if (expressionsPlugin) {\r\n expressionsPlugin.initExpressions(this);\r\n }\r\n\r\n this.loadNextSegment();\r\n };\r\n\r\n AnimationItem.prototype.loadNextSegment = function () {\r\n var segments = this.animationData.segments;\r\n\r\n if (!segments || segments.length === 0 || !this.autoloadSegments) {\r\n this.trigger('data_ready');\r\n this.timeCompleted = this.totalFrames;\r\n return;\r\n }\r\n\r\n var segment = segments.shift();\r\n this.timeCompleted = segment.time * this.frameRate;\r\n var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';\r\n this.segmentPos += 1;\r\n dataManager.loadData(segmentPath, this.includeLayers.bind(this), function () {\r\n this.trigger('data_failed');\r\n }.bind(this));\r\n };\r\n\r\n AnimationItem.prototype.loadSegments = function () {\r\n var segments = this.animationData.segments;\r\n\r\n if (!segments) {\r\n this.timeCompleted = this.totalFrames;\r\n }\r\n\r\n this.loadNextSegment();\r\n };\r\n\r\n AnimationItem.prototype.imagesLoaded = function () {\r\n this.trigger('loaded_images');\r\n this.checkLoaded();\r\n };\r\n\r\n AnimationItem.prototype.preloadImages = function () {\r\n this.imagePreloader.setAssetsPath(this.assetsPath);\r\n this.imagePreloader.setPath(this.path);\r\n this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));\r\n };\r\n\r\n AnimationItem.prototype.configAnimation = function (animData) {\r\n if (!this.renderer) {\r\n return;\r\n }\r\n\r\n try {\r\n this.animationData = animData;\r\n\r\n if (this.initialSegment) {\r\n this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);\r\n this.firstFrame = Math.round(this.initialSegment[0]);\r\n } else {\r\n this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);\r\n this.firstFrame = Math.round(this.animationData.ip);\r\n }\r\n\r\n this.renderer.configAnimation(animData);\r\n\r\n if (!animData.assets) {\r\n animData.assets = [];\r\n }\r\n\r\n this.assets = this.animationData.assets;\r\n this.frameRate = this.animationData.fr;\r\n this.frameMult = this.animationData.fr / 1000;\r\n this.renderer.searchExtraCompositions(animData.assets);\r\n this.markers = markerParser(animData.markers || []);\r\n this.trigger('config_ready');\r\n this.preloadImages();\r\n this.loadSegments();\r\n this.updaFrameModifier();\r\n this.waitForFontsLoaded();\r\n\r\n if (this.isPaused) {\r\n this.audioController.pause();\r\n }\r\n } catch (error) {\r\n this.triggerConfigError(error);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.waitForFontsLoaded = function () {\r\n if (!this.renderer) {\r\n return;\r\n }\r\n\r\n if (this.renderer.globalData.fontManager.isLoaded) {\r\n this.checkLoaded();\r\n } else {\r\n setTimeout(this.waitForFontsLoaded.bind(this), 20);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.checkLoaded = function () {\r\n if (!this.isLoaded && this.renderer.globalData.fontManager.isLoaded && (this.imagePreloader.loadedImages() || this.renderer.rendererType !== 'canvas') && this.imagePreloader.loadedFootages()) {\r\n this.isLoaded = true;\r\n var expressionsPlugin = getExpressionsPlugin();\r\n\r\n if (expressionsPlugin) {\r\n expressionsPlugin.initExpressions(this);\r\n }\r\n\r\n this.renderer.initItems();\r\n setTimeout(function () {\r\n this.trigger('DOMLoaded');\r\n }.bind(this), 0);\r\n this.gotoFrame();\r\n\r\n if (this.autoplay) {\r\n this.play();\r\n }\r\n }\r\n };\r\n\r\n AnimationItem.prototype.resize = function (width, height) {\r\n // Adding this validation for backwards compatibility in case an event object was being passed down\r\n var _width = typeof width === 'number' ? width : undefined;\r\n\r\n var _height = typeof height === 'number' ? height : undefined;\r\n\r\n this.renderer.updateContainerSize(_width, _height);\r\n };\r\n\r\n AnimationItem.prototype.setSubframe = function (flag) {\r\n this.isSubframeEnabled = !!flag;\r\n };\r\n\r\n AnimationItem.prototype.gotoFrame = function () {\r\n this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise\r\n\r\n if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {\r\n this.currentFrame = this.timeCompleted;\r\n }\r\n\r\n this.trigger('enterFrame');\r\n this.renderFrame();\r\n this.trigger('drawnFrame');\r\n };\r\n\r\n AnimationItem.prototype.renderFrame = function () {\r\n if (this.isLoaded === false || !this.renderer) {\r\n return;\r\n }\r\n\r\n try {\r\n this.renderer.renderFrame(this.currentFrame + this.firstFrame);\r\n } catch (error) {\r\n this.triggerRenderFrameError(error);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.play = function (name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n if (this.isPaused === true) {\r\n this.isPaused = false;\r\n this.trigger('_pause');\r\n this.audioController.resume();\r\n\r\n if (this._idle) {\r\n this._idle = false;\r\n this.trigger('_active');\r\n }\r\n }\r\n };\r\n\r\n AnimationItem.prototype.pause = function (name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n if (this.isPaused === false) {\r\n this.isPaused = true;\r\n this.trigger('_play');\r\n this._idle = true;\r\n this.trigger('_idle');\r\n this.audioController.pause();\r\n }\r\n };\r\n\r\n AnimationItem.prototype.togglePause = function (name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n if (this.isPaused === true) {\r\n this.play();\r\n } else {\r\n this.pause();\r\n }\r\n };\r\n\r\n AnimationItem.prototype.stop = function (name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n this.pause();\r\n this.playCount = 0;\r\n this._completedLoop = false;\r\n this.setCurrentRawFrameValue(0);\r\n };\r\n\r\n AnimationItem.prototype.getMarkerData = function (markerName) {\r\n var marker;\r\n\r\n for (var i = 0; i < this.markers.length; i += 1) {\r\n marker = this.markers[i];\r\n\r\n if (marker.payload && marker.payload.name === markerName) {\r\n return marker;\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n var numValue = Number(value);\r\n\r\n if (isNaN(numValue)) {\r\n var marker = this.getMarkerData(value);\r\n\r\n if (marker) {\r\n this.goToAndStop(marker.time, true);\r\n }\r\n } else if (isFrame) {\r\n this.setCurrentRawFrameValue(value);\r\n } else {\r\n this.setCurrentRawFrameValue(value * this.frameModifier);\r\n }\r\n\r\n this.pause();\r\n };\r\n\r\n AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n var numValue = Number(value);\r\n\r\n if (isNaN(numValue)) {\r\n var marker = this.getMarkerData(value);\r\n\r\n if (marker) {\r\n if (!marker.duration) {\r\n this.goToAndStop(marker.time, true);\r\n } else {\r\n this.playSegments([marker.time, marker.time + marker.duration], true);\r\n }\r\n }\r\n } else {\r\n this.goToAndStop(numValue, isFrame, name);\r\n }\r\n\r\n this.play();\r\n };\r\n\r\n AnimationItem.prototype.advanceTime = function (value) {\r\n if (this.isPaused === true || this.isLoaded === false) {\r\n return;\r\n }\r\n\r\n var nextValue = this.currentRawFrame + value * this.frameModifier;\r\n var _isComplete = false; // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.\r\n // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.\r\n\r\n if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {\r\n if (!this.loop || this.playCount === this.loop) {\r\n if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {\r\n _isComplete = true;\r\n nextValue = this.totalFrames - 1;\r\n }\r\n } else if (nextValue >= this.totalFrames) {\r\n this.playCount += 1;\r\n\r\n if (!this.checkSegments(nextValue % this.totalFrames)) {\r\n this.setCurrentRawFrameValue(nextValue % this.totalFrames);\r\n this._completedLoop = true;\r\n this.trigger('loopComplete');\r\n }\r\n } else {\r\n this.setCurrentRawFrameValue(nextValue);\r\n }\r\n } else if (nextValue < 0) {\r\n if (!this.checkSegments(nextValue % this.totalFrames)) {\r\n if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {\r\n // eslint-disable-line no-plusplus\r\n this.setCurrentRawFrameValue(this.totalFrames + nextValue % this.totalFrames);\r\n\r\n if (!this._completedLoop) {\r\n this._completedLoop = true;\r\n } else {\r\n this.trigger('loopComplete');\r\n }\r\n } else {\r\n _isComplete = true;\r\n nextValue = 0;\r\n }\r\n }\r\n } else {\r\n this.setCurrentRawFrameValue(nextValue);\r\n }\r\n\r\n if (_isComplete) {\r\n this.setCurrentRawFrameValue(nextValue);\r\n this.pause();\r\n this.trigger('complete');\r\n }\r\n };\r\n\r\n AnimationItem.prototype.adjustSegment = function (arr, offset) {\r\n this.playCount = 0;\r\n\r\n if (arr[1] < arr[0]) {\r\n if (this.frameModifier > 0) {\r\n if (this.playSpeed < 0) {\r\n this.setSpeed(-this.playSpeed);\r\n } else {\r\n this.setDirection(-1);\r\n }\r\n }\r\n\r\n this.totalFrames = arr[0] - arr[1];\r\n this.timeCompleted = this.totalFrames;\r\n this.firstFrame = arr[1];\r\n this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);\r\n } else if (arr[1] > arr[0]) {\r\n if (this.frameModifier < 0) {\r\n if (this.playSpeed < 0) {\r\n this.setSpeed(-this.playSpeed);\r\n } else {\r\n this.setDirection(1);\r\n }\r\n }\r\n\r\n this.totalFrames = arr[1] - arr[0];\r\n this.timeCompleted = this.totalFrames;\r\n this.firstFrame = arr[0];\r\n this.setCurrentRawFrameValue(0.001 + offset);\r\n }\r\n\r\n this.trigger('segmentStart');\r\n };\r\n\r\n AnimationItem.prototype.setSegment = function (init, end) {\r\n var pendingFrame = -1;\r\n\r\n if (this.isPaused) {\r\n if (this.currentRawFrame + this.firstFrame < init) {\r\n pendingFrame = init;\r\n } else if (this.currentRawFrame + this.firstFrame > end) {\r\n pendingFrame = end - init;\r\n }\r\n }\r\n\r\n this.firstFrame = init;\r\n this.totalFrames = end - init;\r\n this.timeCompleted = this.totalFrames;\r\n\r\n if (pendingFrame !== -1) {\r\n this.goToAndStop(pendingFrame, true);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.playSegments = function (arr, forceFlag) {\r\n if (forceFlag) {\r\n this.segments.length = 0;\r\n }\r\n\r\n if (_typeof$4(arr[0]) === 'object') {\r\n var i;\r\n var len = arr.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.segments.push(arr[i]);\r\n }\r\n } else {\r\n this.segments.push(arr);\r\n }\r\n\r\n if (this.segments.length && forceFlag) {\r\n this.adjustSegment(this.segments.shift(), 0);\r\n }\r\n\r\n if (this.isPaused) {\r\n this.play();\r\n }\r\n };\r\n\r\n AnimationItem.prototype.resetSegments = function (forceFlag) {\r\n this.segments.length = 0;\r\n this.segments.push([this.animationData.ip, this.animationData.op]);\r\n\r\n if (forceFlag) {\r\n this.checkSegments(0);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.checkSegments = function (offset) {\r\n if (this.segments.length) {\r\n this.adjustSegment(this.segments.shift(), offset);\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n AnimationItem.prototype.destroy = function (name) {\r\n if (name && this.name !== name || !this.renderer) {\r\n return;\r\n }\r\n\r\n this.renderer.destroy();\r\n this.imagePreloader.destroy();\r\n this.trigger('destroy');\r\n this._cbs = null;\r\n this.onEnterFrame = null;\r\n this.onLoopComplete = null;\r\n this.onComplete = null;\r\n this.onSegmentStart = null;\r\n this.onDestroy = null;\r\n this.renderer = null;\r\n this.renderer = null;\r\n this.imagePreloader = null;\r\n this.projectInterface = null;\r\n };\r\n\r\n AnimationItem.prototype.setCurrentRawFrameValue = function (value) {\r\n this.currentRawFrame = value;\r\n this.gotoFrame();\r\n };\r\n\r\n AnimationItem.prototype.setSpeed = function (val) {\r\n this.playSpeed = val;\r\n this.updaFrameModifier();\r\n };\r\n\r\n AnimationItem.prototype.setDirection = function (val) {\r\n this.playDirection = val < 0 ? -1 : 1;\r\n this.updaFrameModifier();\r\n };\r\n\r\n AnimationItem.prototype.setLoop = function (isLooping) {\r\n this.loop = isLooping;\r\n };\r\n\r\n AnimationItem.prototype.setVolume = function (val, name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n this.audioController.setVolume(val);\r\n };\r\n\r\n AnimationItem.prototype.getVolume = function () {\r\n return this.audioController.getVolume();\r\n };\r\n\r\n AnimationItem.prototype.mute = function (name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n this.audioController.mute();\r\n };\r\n\r\n AnimationItem.prototype.unmute = function (name) {\r\n if (name && this.name !== name) {\r\n return;\r\n }\r\n\r\n this.audioController.unmute();\r\n };\r\n\r\n AnimationItem.prototype.updaFrameModifier = function () {\r\n this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;\r\n this.audioController.setRate(this.playSpeed * this.playDirection);\r\n };\r\n\r\n AnimationItem.prototype.getPath = function () {\r\n return this.path;\r\n };\r\n\r\n AnimationItem.prototype.getAssetsPath = function (assetData) {\r\n var path = '';\r\n\r\n if (assetData.e) {\r\n path = assetData.p;\r\n } else if (this.assetsPath) {\r\n var imagePath = assetData.p;\r\n\r\n if (imagePath.indexOf('images/') !== -1) {\r\n imagePath = imagePath.split('/')[1];\r\n }\r\n\r\n path = this.assetsPath + imagePath;\r\n } else {\r\n path = this.path;\r\n path += assetData.u ? assetData.u : '';\r\n path += assetData.p;\r\n }\r\n\r\n return path;\r\n };\r\n\r\n AnimationItem.prototype.getAssetData = function (id) {\r\n var i = 0;\r\n var len = this.assets.length;\r\n\r\n while (i < len) {\r\n if (id === this.assets[i].id) {\r\n return this.assets[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n };\r\n\r\n AnimationItem.prototype.hide = function () {\r\n this.renderer.hide();\r\n };\r\n\r\n AnimationItem.prototype.show = function () {\r\n this.renderer.show();\r\n };\r\n\r\n AnimationItem.prototype.getDuration = function (isFrame) {\r\n return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;\r\n };\r\n\r\n AnimationItem.prototype.updateDocumentData = function (path, documentData, index) {\r\n try {\r\n var element = this.renderer.getElementByPath(path);\r\n element.updateDocumentData(documentData, index);\r\n } catch (error) {// TODO: decide how to handle catch case\r\n }\r\n };\r\n\r\n AnimationItem.prototype.trigger = function (name) {\r\n if (this._cbs && this._cbs[name]) {\r\n switch (name) {\r\n case 'enterFrame':\r\n this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));\r\n break;\r\n\r\n case 'drawnFrame':\r\n this.drawnFrameEvent.currentTime = this.currentFrame;\r\n this.drawnFrameEvent.totalTime = this.totalFrames;\r\n this.drawnFrameEvent.direction = this.frameModifier;\r\n this.triggerEvent(name, this.drawnFrameEvent);\r\n break;\r\n\r\n case 'loopComplete':\r\n this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));\r\n break;\r\n\r\n case 'complete':\r\n this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));\r\n break;\r\n\r\n case 'segmentStart':\r\n this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));\r\n break;\r\n\r\n case 'destroy':\r\n this.triggerEvent(name, new BMDestroyEvent(name, this));\r\n break;\r\n\r\n default:\r\n this.triggerEvent(name);\r\n }\r\n }\r\n\r\n if (name === 'enterFrame' && this.onEnterFrame) {\r\n this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));\r\n }\r\n\r\n if (name === 'loopComplete' && this.onLoopComplete) {\r\n this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));\r\n }\r\n\r\n if (name === 'complete' && this.onComplete) {\r\n this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));\r\n }\r\n\r\n if (name === 'segmentStart' && this.onSegmentStart) {\r\n this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));\r\n }\r\n\r\n if (name === 'destroy' && this.onDestroy) {\r\n this.onDestroy.call(this, new BMDestroyEvent(name, this));\r\n }\r\n };\r\n\r\n AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {\r\n var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);\r\n this.triggerEvent('error', error);\r\n\r\n if (this.onError) {\r\n this.onError.call(this, error);\r\n }\r\n };\r\n\r\n AnimationItem.prototype.triggerConfigError = function (nativeError) {\r\n var error = new BMConfigErrorEvent(nativeError, this.currentFrame);\r\n this.triggerEvent('error', error);\r\n\r\n if (this.onError) {\r\n this.onError.call(this, error);\r\n }\r\n };\r\n\r\n var animationManager = function () {\r\n var moduleOb = {};\r\n var registeredAnimations = [];\r\n var initTime = 0;\r\n var len = 0;\r\n var playingAnimationsNum = 0;\r\n var _stopped = true;\r\n var _isFrozen = false;\r\n\r\n function removeElement(ev) {\r\n var i = 0;\r\n var animItem = ev.target;\r\n\r\n while (i < len) {\r\n if (registeredAnimations[i].animation === animItem) {\r\n registeredAnimations.splice(i, 1);\r\n i -= 1;\r\n len -= 1;\r\n\r\n if (!animItem.isPaused) {\r\n subtractPlayingCount();\r\n }\r\n }\r\n\r\n i += 1;\r\n }\r\n }\r\n\r\n function registerAnimation(element, animationData) {\r\n if (!element) {\r\n return null;\r\n }\r\n\r\n var i = 0;\r\n\r\n while (i < len) {\r\n if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {\r\n return registeredAnimations[i].animation;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n var animItem = new AnimationItem();\r\n setupAnimation(animItem, element);\r\n animItem.setData(element, animationData);\r\n return animItem;\r\n }\r\n\r\n function getRegisteredAnimations() {\r\n var i;\r\n var lenAnims = registeredAnimations.length;\r\n var animations = [];\r\n\r\n for (i = 0; i < lenAnims; i += 1) {\r\n animations.push(registeredAnimations[i].animation);\r\n }\r\n\r\n return animations;\r\n }\r\n\r\n function addPlayingCount() {\r\n playingAnimationsNum += 1;\r\n activate();\r\n }\r\n\r\n function subtractPlayingCount() {\r\n playingAnimationsNum -= 1;\r\n }\r\n\r\n function setupAnimation(animItem, element) {\r\n animItem.addEventListener('destroy', removeElement);\r\n animItem.addEventListener('_active', addPlayingCount);\r\n animItem.addEventListener('_idle', subtractPlayingCount);\r\n registeredAnimations.push({\r\n elem: element,\r\n animation: animItem\r\n });\r\n len += 1;\r\n }\r\n\r\n function loadAnimation(params) {\r\n var animItem = new AnimationItem();\r\n setupAnimation(animItem, null);\r\n animItem.setParams(params);\r\n return animItem;\r\n }\r\n\r\n function setSpeed(val, animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.setSpeed(val, animation);\r\n }\r\n }\r\n\r\n function setDirection(val, animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.setDirection(val, animation);\r\n }\r\n }\r\n\r\n function play(animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.play(animation);\r\n }\r\n }\r\n\r\n function resume(nowTime) {\r\n var elapsedTime = nowTime - initTime;\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.advanceTime(elapsedTime);\r\n }\r\n\r\n initTime = nowTime;\r\n\r\n if (playingAnimationsNum && !_isFrozen) {\r\n window.requestAnimationFrame(resume);\r\n } else {\r\n _stopped = true;\r\n }\r\n }\r\n\r\n function first(nowTime) {\r\n initTime = nowTime;\r\n window.requestAnimationFrame(resume);\r\n }\r\n\r\n function pause(animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.pause(animation);\r\n }\r\n }\r\n\r\n function goToAndStop(value, isFrame, animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);\r\n }\r\n }\r\n\r\n function stop(animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.stop(animation);\r\n }\r\n }\r\n\r\n function togglePause(animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.togglePause(animation);\r\n }\r\n }\r\n\r\n function destroy(animation) {\r\n var i;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n registeredAnimations[i].animation.destroy(animation);\r\n }\r\n }\r\n\r\n function searchAnimations(animationData, standalone, renderer) {\r\n var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')), [].slice.call(document.getElementsByClassName('bodymovin')));\r\n var i;\r\n var lenAnims = animElements.length;\r\n\r\n for (i = 0; i < lenAnims; i += 1) {\r\n if (renderer) {\r\n animElements[i].setAttribute('data-bm-type', renderer);\r\n }\r\n\r\n registerAnimation(animElements[i], animationData);\r\n }\r\n\r\n if (standalone && lenAnims === 0) {\r\n if (!renderer) {\r\n renderer = 'svg';\r\n }\r\n\r\n var body = document.getElementsByTagName('body')[0];\r\n body.innerText = '';\r\n var div = createTag('div');\r\n div.style.width = '100%';\r\n div.style.height = '100%';\r\n div.setAttribute('data-bm-type', renderer);\r\n body.appendChild(div);\r\n registerAnimation(div, animationData);\r\n }\r\n }\r\n\r\n function resize() {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.resize();\r\n }\r\n }\r\n\r\n function activate() {\r\n if (!_isFrozen && playingAnimationsNum) {\r\n if (_stopped) {\r\n window.requestAnimationFrame(first);\r\n _stopped = false;\r\n }\r\n }\r\n }\r\n\r\n function freeze() {\r\n _isFrozen = true;\r\n }\r\n\r\n function unfreeze() {\r\n _isFrozen = false;\r\n activate();\r\n }\r\n\r\n function setVolume(val, animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.setVolume(val, animation);\r\n }\r\n }\r\n\r\n function mute(animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.mute(animation);\r\n }\r\n }\r\n\r\n function unmute(animation) {\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registeredAnimations[i].animation.unmute(animation);\r\n }\r\n }\r\n\r\n moduleOb.registerAnimation = registerAnimation;\r\n moduleOb.loadAnimation = loadAnimation;\r\n moduleOb.setSpeed = setSpeed;\r\n moduleOb.setDirection = setDirection;\r\n moduleOb.play = play;\r\n moduleOb.pause = pause;\r\n moduleOb.stop = stop;\r\n moduleOb.togglePause = togglePause;\r\n moduleOb.searchAnimations = searchAnimations;\r\n moduleOb.resize = resize; // moduleOb.start = start;\r\n\r\n moduleOb.goToAndStop = goToAndStop;\r\n moduleOb.destroy = destroy;\r\n moduleOb.freeze = freeze;\r\n moduleOb.unfreeze = unfreeze;\r\n moduleOb.setVolume = setVolume;\r\n moduleOb.mute = mute;\r\n moduleOb.unmute = unmute;\r\n moduleOb.getRegisteredAnimations = getRegisteredAnimations;\r\n return moduleOb;\r\n }();\r\n\r\n /* eslint-disable */\r\n var BezierFactory = function () {\r\n /**\r\n * BezierEasing - use bezier curve for transition easing function\r\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\r\n *\r\n * Credits: is based on Firefox's nsSMILKeySpline.cpp\r\n * Usage:\r\n * var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ])\r\n * spline.get(x) => returns the easing value | x must be in [0, 1] range\r\n *\r\n */\r\n var ob = {};\r\n ob.getBezierEasing = getBezierEasing;\r\n var beziers = {};\r\n\r\n function getBezierEasing(a, b, c, d, nm) {\r\n var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\\./g, 'p');\r\n\r\n if (beziers[str]) {\r\n return beziers[str];\r\n }\r\n\r\n var bezEasing = new BezierEasing([a, b, c, d]);\r\n beziers[str] = bezEasing;\r\n return bezEasing;\r\n } // These values are established by empiricism with tests (tradeoff: performance VS precision)\r\n\r\n\r\n var NEWTON_ITERATIONS = 4;\r\n var NEWTON_MIN_SLOPE = 0.001;\r\n var SUBDIVISION_PRECISION = 0.0000001;\r\n var SUBDIVISION_MAX_ITERATIONS = 10;\r\n var kSplineTableSize = 11;\r\n var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\r\n var float32ArraySupported = typeof Float32Array === 'function';\r\n\r\n function A(aA1, aA2) {\r\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\r\n }\r\n\r\n function B(aA1, aA2) {\r\n return 3.0 * aA2 - 6.0 * aA1;\r\n }\r\n\r\n function C(aA1) {\r\n return 3.0 * aA1;\r\n } // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\r\n\r\n\r\n function calcBezier(aT, aA1, aA2) {\r\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\r\n } // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\r\n\r\n\r\n function getSlope(aT, aA1, aA2) {\r\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\r\n }\r\n\r\n function binarySubdivide(aX, aA, aB, mX1, mX2) {\r\n var currentX,\r\n currentT,\r\n i = 0;\r\n\r\n do {\r\n currentT = aA + (aB - aA) / 2.0;\r\n currentX = calcBezier(currentT, mX1, mX2) - aX;\r\n\r\n if (currentX > 0.0) {\r\n aB = currentT;\r\n } else {\r\n aA = currentT;\r\n }\r\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\r\n\r\n return currentT;\r\n }\r\n\r\n function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\r\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\r\n var currentSlope = getSlope(aGuessT, mX1, mX2);\r\n if (currentSlope === 0.0) return aGuessT;\r\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\r\n aGuessT -= currentX / currentSlope;\r\n }\r\n\r\n return aGuessT;\r\n }\r\n /**\r\n * points is an array of [ mX1, mY1, mX2, mY2 ]\r\n */\r\n\r\n\r\n function BezierEasing(points) {\r\n this._p = points;\r\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n this._precomputed = false;\r\n this.get = this.get.bind(this);\r\n }\r\n\r\n BezierEasing.prototype = {\r\n get: function get(x) {\r\n var mX1 = this._p[0],\r\n mY1 = this._p[1],\r\n mX2 = this._p[2],\r\n mY2 = this._p[3];\r\n if (!this._precomputed) this._precompute();\r\n if (mX1 === mY1 && mX2 === mY2) return x; // linear\r\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\r\n\r\n if (x === 0) return 0;\r\n if (x === 1) return 1;\r\n return calcBezier(this._getTForX(x), mY1, mY2);\r\n },\r\n // Private part\r\n _precompute: function _precompute() {\r\n var mX1 = this._p[0],\r\n mY1 = this._p[1],\r\n mX2 = this._p[2],\r\n mY2 = this._p[3];\r\n this._precomputed = true;\r\n\r\n if (mX1 !== mY1 || mX2 !== mY2) {\r\n this._calcSampleValues();\r\n }\r\n },\r\n _calcSampleValues: function _calcSampleValues() {\r\n var mX1 = this._p[0],\r\n mX2 = this._p[2];\r\n\r\n for (var i = 0; i < kSplineTableSize; ++i) {\r\n this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\r\n }\r\n },\r\n\r\n /**\r\n * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.\r\n */\r\n _getTForX: function _getTForX(aX) {\r\n var mX1 = this._p[0],\r\n mX2 = this._p[2],\r\n mSampleValues = this._mSampleValues;\r\n var intervalStart = 0.0;\r\n var currentSample = 1;\r\n var lastSample = kSplineTableSize - 1;\r\n\r\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\r\n intervalStart += kSampleStepSize;\r\n }\r\n\r\n --currentSample; // Interpolate to provide an initial guess for t\r\n\r\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);\r\n var guessForT = intervalStart + dist * kSampleStepSize;\r\n var initialSlope = getSlope(guessForT, mX1, mX2);\r\n\r\n if (initialSlope >= NEWTON_MIN_SLOPE) {\r\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\r\n }\r\n\r\n if (initialSlope === 0.0) {\r\n return guessForT;\r\n }\r\n\r\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\r\n }\r\n };\r\n return ob;\r\n }();\r\n\r\n var pooling = function () {\r\n function _double(arr) {\r\n return arr.concat(createSizedArray(arr.length));\r\n }\r\n\r\n return {\r\n \"double\": _double\r\n };\r\n }();\r\n\r\n var poolFactory = function () {\r\n return function (initialLength, _create, _release) {\r\n var _length = 0;\r\n var _maxLength = initialLength;\r\n var pool = createSizedArray(_maxLength);\r\n var ob = {\r\n newElement: newElement,\r\n release: release\r\n };\r\n\r\n function newElement() {\r\n var element;\r\n\r\n if (_length) {\r\n _length -= 1;\r\n element = pool[_length];\r\n } else {\r\n element = _create();\r\n }\r\n\r\n return element;\r\n }\r\n\r\n function release(element) {\r\n if (_length === _maxLength) {\r\n pool = pooling[\"double\"](pool);\r\n _maxLength *= 2;\r\n }\r\n\r\n if (_release) {\r\n _release(element);\r\n }\r\n\r\n pool[_length] = element;\r\n _length += 1;\r\n }\r\n\r\n return ob;\r\n };\r\n }();\r\n\r\n var bezierLengthPool = function () {\r\n function create() {\r\n return {\r\n addedLength: 0,\r\n percents: createTypedArray('float32', getDefaultCurveSegments()),\r\n lengths: createTypedArray('float32', getDefaultCurveSegments())\r\n };\r\n }\r\n\r\n return poolFactory(8, create);\r\n }();\r\n\r\n var segmentsLengthPool = function () {\r\n function create() {\r\n return {\r\n lengths: [],\r\n totalLength: 0\r\n };\r\n }\r\n\r\n function release(element) {\r\n var i;\r\n var len = element.lengths.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n bezierLengthPool.release(element.lengths[i]);\r\n }\r\n\r\n element.lengths.length = 0;\r\n }\r\n\r\n return poolFactory(8, create, release);\r\n }();\r\n\r\n function bezFunction() {\r\n var math = Math;\r\n\r\n function pointOnLine2D(x1, y1, x2, y2, x3, y3) {\r\n var det1 = x1 * y2 + y1 * x3 + x2 * y3 - x3 * y2 - y3 * x1 - x2 * y1;\r\n return det1 > -0.001 && det1 < 0.001;\r\n }\r\n\r\n function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {\r\n if (z1 === 0 && z2 === 0 && z3 === 0) {\r\n return pointOnLine2D(x1, y1, x2, y2, x3, y3);\r\n }\r\n\r\n var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));\r\n var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));\r\n var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));\r\n var diffDist;\r\n\r\n if (dist1 > dist2) {\r\n if (dist1 > dist3) {\r\n diffDist = dist1 - dist2 - dist3;\r\n } else {\r\n diffDist = dist3 - dist2 - dist1;\r\n }\r\n } else if (dist3 > dist2) {\r\n diffDist = dist3 - dist2 - dist1;\r\n } else {\r\n diffDist = dist2 - dist1 - dist3;\r\n }\r\n\r\n return diffDist > -0.0001 && diffDist < 0.0001;\r\n }\r\n\r\n var getBezierLength = function () {\r\n return function (pt1, pt2, pt3, pt4) {\r\n var curveSegments = getDefaultCurveSegments();\r\n var k;\r\n var i;\r\n var len;\r\n var ptCoord;\r\n var perc;\r\n var addedLength = 0;\r\n var ptDistance;\r\n var point = [];\r\n var lastPoint = [];\r\n var lengthData = bezierLengthPool.newElement();\r\n len = pt3.length;\r\n\r\n for (k = 0; k < curveSegments; k += 1) {\r\n perc = k / (curveSegments - 1);\r\n ptDistance = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i];\r\n point[i] = ptCoord;\r\n\r\n if (lastPoint[i] !== null) {\r\n ptDistance += bmPow(point[i] - lastPoint[i], 2);\r\n }\r\n\r\n lastPoint[i] = point[i];\r\n }\r\n\r\n if (ptDistance) {\r\n ptDistance = bmSqrt(ptDistance);\r\n addedLength += ptDistance;\r\n }\r\n\r\n lengthData.percents[k] = perc;\r\n lengthData.lengths[k] = addedLength;\r\n }\r\n\r\n lengthData.addedLength = addedLength;\r\n return lengthData;\r\n };\r\n }();\r\n\r\n function getSegmentsLength(shapeData) {\r\n var segmentsLength = segmentsLengthPool.newElement();\r\n var closed = shapeData.c;\r\n var pathV = shapeData.v;\r\n var pathO = shapeData.o;\r\n var pathI = shapeData.i;\r\n var i;\r\n var len = shapeData._length;\r\n var lengths = segmentsLength.lengths;\r\n var totalLength = 0;\r\n\r\n for (i = 0; i < len - 1; i += 1) {\r\n lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);\r\n totalLength += lengths[i].addedLength;\r\n }\r\n\r\n if (closed && len) {\r\n lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);\r\n totalLength += lengths[i].addedLength;\r\n }\r\n\r\n segmentsLength.totalLength = totalLength;\r\n return segmentsLength;\r\n }\r\n\r\n function BezierData(length) {\r\n this.segmentLength = 0;\r\n this.points = new Array(length);\r\n }\r\n\r\n function PointData(partial, point) {\r\n this.partialLength = partial;\r\n this.point = point;\r\n }\r\n\r\n var buildBezierData = function () {\r\n var storedData = {};\r\n return function (pt1, pt2, pt3, pt4) {\r\n var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\\./g, 'p');\r\n\r\n if (!storedData[bezierName]) {\r\n var curveSegments = getDefaultCurveSegments();\r\n var k;\r\n var i;\r\n var len;\r\n var ptCoord;\r\n var perc;\r\n var addedLength = 0;\r\n var ptDistance;\r\n var point;\r\n var lastPoint = null;\r\n\r\n if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) {\r\n curveSegments = 2;\r\n }\r\n\r\n var bezierData = new BezierData(curveSegments);\r\n len = pt3.length;\r\n\r\n for (k = 0; k < curveSegments; k += 1) {\r\n point = createSizedArray(len);\r\n perc = k / (curveSegments - 1);\r\n ptDistance = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i];\r\n point[i] = ptCoord;\r\n\r\n if (lastPoint !== null) {\r\n ptDistance += bmPow(point[i] - lastPoint[i], 2);\r\n }\r\n }\r\n\r\n ptDistance = bmSqrt(ptDistance);\r\n addedLength += ptDistance;\r\n bezierData.points[k] = new PointData(ptDistance, point);\r\n lastPoint = point;\r\n }\r\n\r\n bezierData.segmentLength = addedLength;\r\n storedData[bezierName] = bezierData;\r\n }\r\n\r\n return storedData[bezierName];\r\n };\r\n }();\r\n\r\n function getDistancePerc(perc, bezierData) {\r\n var percents = bezierData.percents;\r\n var lengths = bezierData.lengths;\r\n var len = percents.length;\r\n var initPos = bmFloor((len - 1) * perc);\r\n var lengthPos = perc * bezierData.addedLength;\r\n var lPerc = 0;\r\n\r\n if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {\r\n return percents[initPos];\r\n }\r\n\r\n var dir = lengths[initPos] > lengthPos ? -1 : 1;\r\n var flag = true;\r\n\r\n while (flag) {\r\n if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {\r\n lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);\r\n flag = false;\r\n } else {\r\n initPos += dir;\r\n }\r\n\r\n if (initPos < 0 || initPos >= len - 1) {\r\n // FIX for TypedArrays that don't store floating point values with enough accuracy\r\n if (initPos === len - 1) {\r\n return percents[initPos];\r\n }\r\n\r\n flag = false;\r\n }\r\n }\r\n\r\n return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;\r\n }\r\n\r\n function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {\r\n var t1 = getDistancePerc(percent, bezierData);\r\n var u1 = 1 - t1;\r\n var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000;\r\n var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000;\r\n return [ptX, ptY];\r\n }\r\n\r\n var bezierSegmentPoints = createTypedArray('float32', 8);\r\n\r\n function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {\r\n if (startPerc < 0) {\r\n startPerc = 0;\r\n } else if (startPerc > 1) {\r\n startPerc = 1;\r\n }\r\n\r\n var t0 = getDistancePerc(startPerc, bezierData);\r\n endPerc = endPerc > 1 ? 1 : endPerc;\r\n var t1 = getDistancePerc(endPerc, bezierData);\r\n var i;\r\n var len = pt1.length;\r\n var u0 = 1 - t0;\r\n var u1 = 1 - t1;\r\n var u0u0u0 = u0 * u0 * u0;\r\n var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase\r\n\r\n var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase\r\n\r\n var t0t0t0 = t0 * t0 * t0; //\r\n\r\n var u0u0u1 = u0 * u0 * u1;\r\n var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase\r\n\r\n var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase\r\n\r\n var t0t0t1 = t0 * t0 * t1; //\r\n\r\n var u0u1u1 = u0 * u1 * u1;\r\n var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase\r\n\r\n var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase\r\n\r\n var t0t1t1 = t0 * t1 * t1; //\r\n\r\n var u1u1u1 = u1 * u1 * u1;\r\n var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase\r\n\r\n var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase\r\n\r\n var t1t1t1 = t1 * t1 * t1;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\r\n\r\n bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\r\n\r\n bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\r\n\r\n bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\r\n }\r\n\r\n return bezierSegmentPoints;\r\n }\r\n\r\n return {\r\n getSegmentsLength: getSegmentsLength,\r\n getNewSegment: getNewSegment,\r\n getPointInSegment: getPointInSegment,\r\n buildBezierData: buildBezierData,\r\n pointOnLine2D: pointOnLine2D,\r\n pointOnLine3D: pointOnLine3D\r\n };\r\n }\r\n\r\n var bez = bezFunction();\r\n\r\n var PropertyFactory = function () {\r\n var initFrame = initialDefaultFrame;\r\n var mathAbs = Math.abs;\r\n\r\n function interpolateValue(frameNum, caching) {\r\n var offsetTime = this.offsetTime;\r\n var newValue;\r\n\r\n if (this.propType === 'multidimensional') {\r\n newValue = createTypedArray('float32', this.pv.length);\r\n }\r\n\r\n var iterationIndex = caching.lastIndex;\r\n var i = iterationIndex;\r\n var len = this.keyframes.length - 1;\r\n var flag = true;\r\n var keyData;\r\n var nextKeyData;\r\n var keyframeMetadata;\r\n\r\n while (flag) {\r\n keyData = this.keyframes[i];\r\n nextKeyData = this.keyframes[i + 1];\r\n\r\n if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {\r\n if (keyData.h) {\r\n keyData = nextKeyData;\r\n }\r\n\r\n iterationIndex = 0;\r\n break;\r\n }\r\n\r\n if (nextKeyData.t - offsetTime > frameNum) {\r\n iterationIndex = i;\r\n break;\r\n }\r\n\r\n if (i < len - 1) {\r\n i += 1;\r\n } else {\r\n iterationIndex = 0;\r\n flag = false;\r\n }\r\n }\r\n\r\n keyframeMetadata = this.keyframesMetadata[i] || {};\r\n var k;\r\n var kLen;\r\n var perc;\r\n var jLen;\r\n var j;\r\n var fnc;\r\n var nextKeyTime = nextKeyData.t - offsetTime;\r\n var keyTime = keyData.t - offsetTime;\r\n var endValue;\r\n\r\n if (keyData.to) {\r\n if (!keyframeMetadata.bezierData) {\r\n keyframeMetadata.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);\r\n }\r\n\r\n var bezierData = keyframeMetadata.bezierData;\r\n\r\n if (frameNum >= nextKeyTime || frameNum < keyTime) {\r\n var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;\r\n kLen = bezierData.points[ind].point.length;\r\n\r\n for (k = 0; k < kLen; k += 1) {\r\n newValue[k] = bezierData.points[ind].point[k];\r\n } // caching._lastKeyframeIndex = -1;\r\n\r\n } else {\r\n if (keyframeMetadata.__fnct) {\r\n fnc = keyframeMetadata.__fnct;\r\n } else {\r\n fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;\r\n keyframeMetadata.__fnct = fnc;\r\n }\r\n\r\n perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));\r\n var distanceInLine = bezierData.segmentLength * perc;\r\n var segmentPerc;\r\n var addedLength = caching.lastFrame < frameNum && caching._lastKeyframeIndex === i ? caching._lastAddedLength : 0;\r\n j = caching.lastFrame < frameNum && caching._lastKeyframeIndex === i ? caching._lastPoint : 0;\r\n flag = true;\r\n jLen = bezierData.points.length;\r\n\r\n while (flag) {\r\n addedLength += bezierData.points[j].partialLength;\r\n\r\n if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {\r\n kLen = bezierData.points[j].point.length;\r\n\r\n for (k = 0; k < kLen; k += 1) {\r\n newValue[k] = bezierData.points[j].point[k];\r\n }\r\n\r\n break;\r\n } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {\r\n segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;\r\n kLen = bezierData.points[j].point.length;\r\n\r\n for (k = 0; k < kLen; k += 1) {\r\n newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;\r\n }\r\n\r\n break;\r\n }\r\n\r\n if (j < jLen - 1) {\r\n j += 1;\r\n } else {\r\n flag = false;\r\n }\r\n }\r\n\r\n caching._lastPoint = j;\r\n caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;\r\n caching._lastKeyframeIndex = i;\r\n }\r\n } else {\r\n var outX;\r\n var outY;\r\n var inX;\r\n var inY;\r\n var keyValue;\r\n len = keyData.s.length;\r\n endValue = nextKeyData.s || keyData.e;\r\n\r\n if (this.sh && keyData.h !== 1) {\r\n if (frameNum >= nextKeyTime) {\r\n newValue[0] = endValue[0];\r\n newValue[1] = endValue[1];\r\n newValue[2] = endValue[2];\r\n } else if (frameNum <= keyTime) {\r\n newValue[0] = keyData.s[0];\r\n newValue[1] = keyData.s[1];\r\n newValue[2] = keyData.s[2];\r\n } else {\r\n var quatStart = createQuaternion(keyData.s);\r\n var quatEnd = createQuaternion(endValue);\r\n var time = (frameNum - keyTime) / (nextKeyTime - keyTime);\r\n quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));\r\n }\r\n } else {\r\n for (i = 0; i < len; i += 1) {\r\n if (keyData.h !== 1) {\r\n if (frameNum >= nextKeyTime) {\r\n perc = 1;\r\n } else if (frameNum < keyTime) {\r\n perc = 0;\r\n } else {\r\n if (keyData.o.x.constructor === Array) {\r\n if (!keyframeMetadata.__fnct) {\r\n keyframeMetadata.__fnct = [];\r\n }\r\n\r\n if (!keyframeMetadata.__fnct[i]) {\r\n outX = keyData.o.x[i] === undefined ? keyData.o.x[0] : keyData.o.x[i];\r\n outY = keyData.o.y[i] === undefined ? keyData.o.y[0] : keyData.o.y[i];\r\n inX = keyData.i.x[i] === undefined ? keyData.i.x[0] : keyData.i.x[i];\r\n inY = keyData.i.y[i] === undefined ? keyData.i.y[0] : keyData.i.y[i];\r\n fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;\r\n keyframeMetadata.__fnct[i] = fnc;\r\n } else {\r\n fnc = keyframeMetadata.__fnct[i];\r\n }\r\n } else if (!keyframeMetadata.__fnct) {\r\n outX = keyData.o.x;\r\n outY = keyData.o.y;\r\n inX = keyData.i.x;\r\n inY = keyData.i.y;\r\n fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;\r\n keyData.keyframeMetadata = fnc;\r\n } else {\r\n fnc = keyframeMetadata.__fnct;\r\n }\r\n\r\n perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));\r\n }\r\n }\r\n\r\n endValue = nextKeyData.s || keyData.e;\r\n keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;\r\n\r\n if (this.propType === 'multidimensional') {\r\n newValue[i] = keyValue;\r\n } else {\r\n newValue = keyValue;\r\n }\r\n }\r\n }\r\n }\r\n\r\n caching.lastIndex = iterationIndex;\r\n return newValue;\r\n } // based on @Toji's https://github.com/toji/gl-matrix/\r\n\r\n\r\n function slerp(a, b, t) {\r\n var out = [];\r\n var ax = a[0];\r\n var ay = a[1];\r\n var az = a[2];\r\n var aw = a[3];\r\n var bx = b[0];\r\n var by = b[1];\r\n var bz = b[2];\r\n var bw = b[3];\r\n var omega;\r\n var cosom;\r\n var sinom;\r\n var scale0;\r\n var scale1;\r\n cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n\r\n if (1.0 - cosom > 0.000001) {\r\n omega = Math.acos(cosom);\r\n sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n return out;\r\n }\r\n\r\n function quaternionToEuler(out, quat) {\r\n var qx = quat[0];\r\n var qy = quat[1];\r\n var qz = quat[2];\r\n var qw = quat[3];\r\n var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);\r\n var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);\r\n var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);\r\n out[0] = heading / degToRads;\r\n out[1] = attitude / degToRads;\r\n out[2] = bank / degToRads;\r\n }\r\n\r\n function createQuaternion(values) {\r\n var heading = values[0] * degToRads;\r\n var attitude = values[1] * degToRads;\r\n var bank = values[2] * degToRads;\r\n var c1 = Math.cos(heading / 2);\r\n var c2 = Math.cos(attitude / 2);\r\n var c3 = Math.cos(bank / 2);\r\n var s1 = Math.sin(heading / 2);\r\n var s2 = Math.sin(attitude / 2);\r\n var s3 = Math.sin(bank / 2);\r\n var w = c1 * c2 * c3 - s1 * s2 * s3;\r\n var x = s1 * s2 * c3 + c1 * c2 * s3;\r\n var y = s1 * c2 * c3 + c1 * s2 * s3;\r\n var z = c1 * s2 * c3 - s1 * c2 * s3;\r\n return [x, y, z, w];\r\n }\r\n\r\n function getValueAtCurrentTime() {\r\n var frameNum = this.comp.renderedFrame - this.offsetTime;\r\n var initTime = this.keyframes[0].t - this.offsetTime;\r\n var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;\r\n\r\n if (!(frameNum === this._caching.lastFrame || this._caching.lastFrame !== initFrame && (this._caching.lastFrame >= endTime && frameNum >= endTime || this._caching.lastFrame < initTime && frameNum < initTime))) {\r\n if (this._caching.lastFrame >= frameNum) {\r\n this._caching._lastKeyframeIndex = -1;\r\n this._caching.lastIndex = 0;\r\n }\r\n\r\n var renderResult = this.interpolateValue(frameNum, this._caching);\r\n this.pv = renderResult;\r\n }\r\n\r\n this._caching.lastFrame = frameNum;\r\n return this.pv;\r\n }\r\n\r\n function setVValue(val) {\r\n var multipliedValue;\r\n\r\n if (this.propType === 'unidimensional') {\r\n multipliedValue = val * this.mult;\r\n\r\n if (mathAbs(this.v - multipliedValue) > 0.00001) {\r\n this.v = multipliedValue;\r\n this._mdf = true;\r\n }\r\n } else {\r\n var i = 0;\r\n var len = this.v.length;\r\n\r\n while (i < len) {\r\n multipliedValue = val[i] * this.mult;\r\n\r\n if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {\r\n this.v[i] = multipliedValue;\r\n this._mdf = true;\r\n }\r\n\r\n i += 1;\r\n }\r\n }\r\n }\r\n\r\n function processEffectsSequence() {\r\n if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {\r\n return;\r\n }\r\n\r\n if (this.lock) {\r\n this.setVValue(this.pv);\r\n return;\r\n }\r\n\r\n this.lock = true;\r\n this._mdf = this._isFirstFrame;\r\n var i;\r\n var len = this.effectsSequence.length;\r\n var finalValue = this.kf ? this.pv : this.data.k;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n finalValue = this.effectsSequence[i](finalValue);\r\n }\r\n\r\n this.setVValue(finalValue);\r\n this._isFirstFrame = false;\r\n this.lock = false;\r\n this.frameId = this.elem.globalData.frameId;\r\n }\r\n\r\n function addEffect(effectFunction) {\r\n this.effectsSequence.push(effectFunction);\r\n this.container.addDynamicProperty(this);\r\n }\r\n\r\n function ValueProperty(elem, data, mult, container) {\r\n this.propType = 'unidimensional';\r\n this.mult = mult || 1;\r\n this.data = data;\r\n this.v = mult ? data.k * mult : data.k;\r\n this.pv = data.k;\r\n this._mdf = false;\r\n this.elem = elem;\r\n this.container = container;\r\n this.comp = elem.comp;\r\n this.k = false;\r\n this.kf = false;\r\n this.vel = 0;\r\n this.effectsSequence = [];\r\n this._isFirstFrame = true;\r\n this.getValue = processEffectsSequence;\r\n this.setVValue = setVValue;\r\n this.addEffect = addEffect;\r\n }\r\n\r\n function MultiDimensionalProperty(elem, data, mult, container) {\r\n this.propType = 'multidimensional';\r\n this.mult = mult || 1;\r\n this.data = data;\r\n this._mdf = false;\r\n this.elem = elem;\r\n this.container = container;\r\n this.comp = elem.comp;\r\n this.k = false;\r\n this.kf = false;\r\n this.frameId = -1;\r\n var i;\r\n var len = data.k.length;\r\n this.v = createTypedArray('float32', len);\r\n this.pv = createTypedArray('float32', len);\r\n this.vel = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.v[i] = data.k[i] * this.mult;\r\n this.pv[i] = data.k[i];\r\n }\r\n\r\n this._isFirstFrame = true;\r\n this.effectsSequence = [];\r\n this.getValue = processEffectsSequence;\r\n this.setVValue = setVValue;\r\n this.addEffect = addEffect;\r\n }\r\n\r\n function KeyframedValueProperty(elem, data, mult, container) {\r\n this.propType = 'unidimensional';\r\n this.keyframes = data.k;\r\n this.keyframesMetadata = [];\r\n this.offsetTime = elem.data.st;\r\n this.frameId = -1;\r\n this._caching = {\r\n lastFrame: initFrame,\r\n lastIndex: 0,\r\n value: 0,\r\n _lastKeyframeIndex: -1\r\n };\r\n this.k = true;\r\n this.kf = true;\r\n this.data = data;\r\n this.mult = mult || 1;\r\n this.elem = elem;\r\n this.container = container;\r\n this.comp = elem.comp;\r\n this.v = initFrame;\r\n this.pv = initFrame;\r\n this._isFirstFrame = true;\r\n this.getValue = processEffectsSequence;\r\n this.setVValue = setVValue;\r\n this.interpolateValue = interpolateValue;\r\n this.effectsSequence = [getValueAtCurrentTime.bind(this)];\r\n this.addEffect = addEffect;\r\n }\r\n\r\n function KeyframedMultidimensionalProperty(elem, data, mult, container) {\r\n this.propType = 'multidimensional';\r\n var i;\r\n var len = data.k.length;\r\n var s;\r\n var e;\r\n var to;\r\n var ti;\r\n\r\n for (i = 0; i < len - 1; i += 1) {\r\n if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {\r\n s = data.k[i].s;\r\n e = data.k[i + 1].s;\r\n to = data.k[i].to;\r\n ti = data.k[i].ti;\r\n\r\n if (s.length === 2 && !(s[0] === e[0] && s[1] === e[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], s[0] + to[0], s[1] + to[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], e[0] + ti[0], e[1] + ti[1]) || s.length === 3 && !(s[0] === e[0] && s[1] === e[1] && s[2] === e[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], s[0] + to[0], s[1] + to[1], s[2] + to[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], e[0] + ti[0], e[1] + ti[1], e[2] + ti[2])) {\r\n data.k[i].to = null;\r\n data.k[i].ti = null;\r\n }\r\n\r\n if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {\r\n if (s.length === 2 || s[2] === e[2] && to[2] === 0 && ti[2] === 0) {\r\n data.k[i].to = null;\r\n data.k[i].ti = null;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.effectsSequence = [getValueAtCurrentTime.bind(this)];\r\n this.data = data;\r\n this.keyframes = data.k;\r\n this.keyframesMetadata = [];\r\n this.offsetTime = elem.data.st;\r\n this.k = true;\r\n this.kf = true;\r\n this._isFirstFrame = true;\r\n this.mult = mult || 1;\r\n this.elem = elem;\r\n this.container = container;\r\n this.comp = elem.comp;\r\n this.getValue = processEffectsSequence;\r\n this.setVValue = setVValue;\r\n this.interpolateValue = interpolateValue;\r\n this.frameId = -1;\r\n var arrLen = data.k[0].s.length;\r\n this.v = createTypedArray('float32', arrLen);\r\n this.pv = createTypedArray('float32', arrLen);\r\n\r\n for (i = 0; i < arrLen; i += 1) {\r\n this.v[i] = initFrame;\r\n this.pv[i] = initFrame;\r\n }\r\n\r\n this._caching = {\r\n lastFrame: initFrame,\r\n lastIndex: 0,\r\n value: createTypedArray('float32', arrLen)\r\n };\r\n this.addEffect = addEffect;\r\n }\r\n\r\n function getProp(elem, data, type, mult, container) {\r\n var p;\r\n\r\n if (!data.k.length) {\r\n p = new ValueProperty(elem, data, mult, container);\r\n } else if (typeof data.k[0] === 'number') {\r\n p = new MultiDimensionalProperty(elem, data, mult, container);\r\n } else {\r\n switch (type) {\r\n case 0:\r\n p = new KeyframedValueProperty(elem, data, mult, container);\r\n break;\r\n\r\n case 1:\r\n p = new KeyframedMultidimensionalProperty(elem, data, mult, container);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n if (p.effectsSequence.length) {\r\n container.addDynamicProperty(p);\r\n }\r\n\r\n return p;\r\n }\r\n\r\n var ob = {\r\n getProp: getProp\r\n };\r\n return ob;\r\n }();\r\n\r\n function DynamicPropertyContainer() {}\r\n\r\n DynamicPropertyContainer.prototype = {\r\n addDynamicProperty: function addDynamicProperty(prop) {\r\n if (this.dynamicProperties.indexOf(prop) === -1) {\r\n this.dynamicProperties.push(prop);\r\n this.container.addDynamicProperty(this);\r\n this._isAnimated = true;\r\n }\r\n },\r\n iterateDynamicProperties: function iterateDynamicProperties() {\r\n this._mdf = false;\r\n var i;\r\n var len = this.dynamicProperties.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.dynamicProperties[i].getValue();\r\n\r\n if (this.dynamicProperties[i]._mdf) {\r\n this._mdf = true;\r\n }\r\n }\r\n },\r\n initDynamicPropertyContainer: function initDynamicPropertyContainer(container) {\r\n this.container = container;\r\n this.dynamicProperties = [];\r\n this._mdf = false;\r\n this._isAnimated = false;\r\n }\r\n };\r\n\r\n var pointPool = function () {\r\n function create() {\r\n return createTypedArray('float32', 2);\r\n }\r\n\r\n return poolFactory(8, create);\r\n }();\r\n\r\n function ShapePath() {\r\n this.c = false;\r\n this._length = 0;\r\n this._maxLength = 8;\r\n this.v = createSizedArray(this._maxLength);\r\n this.o = createSizedArray(this._maxLength);\r\n this.i = createSizedArray(this._maxLength);\r\n }\r\n\r\n ShapePath.prototype.setPathData = function (closed, len) {\r\n this.c = closed;\r\n this.setLength(len);\r\n var i = 0;\r\n\r\n while (i < len) {\r\n this.v[i] = pointPool.newElement();\r\n this.o[i] = pointPool.newElement();\r\n this.i[i] = pointPool.newElement();\r\n i += 1;\r\n }\r\n };\r\n\r\n ShapePath.prototype.setLength = function (len) {\r\n while (this._maxLength < len) {\r\n this.doubleArrayLength();\r\n }\r\n\r\n this._length = len;\r\n };\r\n\r\n ShapePath.prototype.doubleArrayLength = function () {\r\n this.v = this.v.concat(createSizedArray(this._maxLength));\r\n this.i = this.i.concat(createSizedArray(this._maxLength));\r\n this.o = this.o.concat(createSizedArray(this._maxLength));\r\n this._maxLength *= 2;\r\n };\r\n\r\n ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {\r\n var arr;\r\n this._length = Math.max(this._length, pos + 1);\r\n\r\n if (this._length >= this._maxLength) {\r\n this.doubleArrayLength();\r\n }\r\n\r\n switch (type) {\r\n case 'v':\r\n arr = this.v;\r\n break;\r\n\r\n case 'i':\r\n arr = this.i;\r\n break;\r\n\r\n case 'o':\r\n arr = this.o;\r\n break;\r\n\r\n default:\r\n arr = [];\r\n break;\r\n }\r\n\r\n if (!arr[pos] || arr[pos] && !replace) {\r\n arr[pos] = pointPool.newElement();\r\n }\r\n\r\n arr[pos][0] = x;\r\n arr[pos][1] = y;\r\n };\r\n\r\n ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {\r\n this.setXYAt(vX, vY, 'v', pos, replace);\r\n this.setXYAt(oX, oY, 'o', pos, replace);\r\n this.setXYAt(iX, iY, 'i', pos, replace);\r\n };\r\n\r\n ShapePath.prototype.reverse = function () {\r\n var newPath = new ShapePath();\r\n newPath.setPathData(this.c, this._length);\r\n var vertices = this.v;\r\n var outPoints = this.o;\r\n var inPoints = this.i;\r\n var init = 0;\r\n\r\n if (this.c) {\r\n newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);\r\n init = 1;\r\n }\r\n\r\n var cnt = this._length - 1;\r\n var len = this._length;\r\n var i;\r\n\r\n for (i = init; i < len; i += 1) {\r\n newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);\r\n cnt -= 1;\r\n }\r\n\r\n return newPath;\r\n };\r\n\r\n ShapePath.prototype.length = function () {\r\n return this._length;\r\n };\r\n\r\n var shapePool = function () {\r\n function create() {\r\n return new ShapePath();\r\n }\r\n\r\n function release(shapePath) {\r\n var len = shapePath._length;\r\n var i;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n pointPool.release(shapePath.v[i]);\r\n pointPool.release(shapePath.i[i]);\r\n pointPool.release(shapePath.o[i]);\r\n shapePath.v[i] = null;\r\n shapePath.i[i] = null;\r\n shapePath.o[i] = null;\r\n }\r\n\r\n shapePath._length = 0;\r\n shapePath.c = false;\r\n }\r\n\r\n function clone(shape) {\r\n var cloned = factory.newElement();\r\n var i;\r\n var len = shape._length === undefined ? shape.v.length : shape._length;\r\n cloned.setLength(len);\r\n cloned.c = shape.c;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n cloned.setTripleAt(shape.v[i][0], shape.v[i][1], shape.o[i][0], shape.o[i][1], shape.i[i][0], shape.i[i][1], i);\r\n }\r\n\r\n return cloned;\r\n }\r\n\r\n var factory = poolFactory(4, create, release);\r\n factory.clone = clone;\r\n return factory;\r\n }();\r\n\r\n function ShapeCollection() {\r\n this._length = 0;\r\n this._maxLength = 4;\r\n this.shapes = createSizedArray(this._maxLength);\r\n }\r\n\r\n ShapeCollection.prototype.addShape = function (shapeData) {\r\n if (this._length === this._maxLength) {\r\n this.shapes = this.shapes.concat(createSizedArray(this._maxLength));\r\n this._maxLength *= 2;\r\n }\r\n\r\n this.shapes[this._length] = shapeData;\r\n this._length += 1;\r\n };\r\n\r\n ShapeCollection.prototype.releaseShapes = function () {\r\n var i;\r\n\r\n for (i = 0; i < this._length; i += 1) {\r\n shapePool.release(this.shapes[i]);\r\n }\r\n\r\n this._length = 0;\r\n };\r\n\r\n var shapeCollectionPool = function () {\r\n var ob = {\r\n newShapeCollection: newShapeCollection,\r\n release: release\r\n };\r\n var _length = 0;\r\n var _maxLength = 4;\r\n var pool = createSizedArray(_maxLength);\r\n\r\n function newShapeCollection() {\r\n var shapeCollection;\r\n\r\n if (_length) {\r\n _length -= 1;\r\n shapeCollection = pool[_length];\r\n } else {\r\n shapeCollection = new ShapeCollection();\r\n }\r\n\r\n return shapeCollection;\r\n }\r\n\r\n function release(shapeCollection) {\r\n var i;\r\n var len = shapeCollection._length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapePool.release(shapeCollection.shapes[i]);\r\n }\r\n\r\n shapeCollection._length = 0;\r\n\r\n if (_length === _maxLength) {\r\n pool = pooling[\"double\"](pool);\r\n _maxLength *= 2;\r\n }\r\n\r\n pool[_length] = shapeCollection;\r\n _length += 1;\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n var ShapePropertyFactory = function () {\r\n var initFrame = -999999;\r\n\r\n function interpolateShape(frameNum, previousValue, caching) {\r\n var iterationIndex = caching.lastIndex;\r\n var keyPropS;\r\n var keyPropE;\r\n var isHold;\r\n var j;\r\n var k;\r\n var jLen;\r\n var kLen;\r\n var perc;\r\n var vertexValue;\r\n var kf = this.keyframes;\r\n\r\n if (frameNum < kf[0].t - this.offsetTime) {\r\n keyPropS = kf[0].s[0];\r\n isHold = true;\r\n iterationIndex = 0;\r\n } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {\r\n keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];\r\n /* if(kf[kf.length - 1].s){\r\n keyPropS = kf[kf.length - 1].s[0];\r\n }else{\r\n keyPropS = kf[kf.length - 2].e[0];\r\n } */\r\n\r\n isHold = true;\r\n } else {\r\n var i = iterationIndex;\r\n var len = kf.length - 1;\r\n var flag = true;\r\n var keyData;\r\n var nextKeyData;\r\n var keyframeMetadata;\r\n\r\n while (flag) {\r\n keyData = kf[i];\r\n nextKeyData = kf[i + 1];\r\n\r\n if (nextKeyData.t - this.offsetTime > frameNum) {\r\n break;\r\n }\r\n\r\n if (i < len - 1) {\r\n i += 1;\r\n } else {\r\n flag = false;\r\n }\r\n }\r\n\r\n keyframeMetadata = this.keyframesMetadata[i] || {};\r\n isHold = keyData.h === 1;\r\n iterationIndex = i;\r\n\r\n if (!isHold) {\r\n if (frameNum >= nextKeyData.t - this.offsetTime) {\r\n perc = 1;\r\n } else if (frameNum < keyData.t - this.offsetTime) {\r\n perc = 0;\r\n } else {\r\n var fnc;\r\n\r\n if (keyframeMetadata.__fnct) {\r\n fnc = keyframeMetadata.__fnct;\r\n } else {\r\n fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;\r\n keyframeMetadata.__fnct = fnc;\r\n }\r\n\r\n perc = fnc((frameNum - (keyData.t - this.offsetTime)) / (nextKeyData.t - this.offsetTime - (keyData.t - this.offsetTime)));\r\n }\r\n\r\n keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];\r\n }\r\n\r\n keyPropS = keyData.s[0];\r\n }\r\n\r\n jLen = previousValue._length;\r\n kLen = keyPropS.i[0].length;\r\n caching.lastIndex = iterationIndex;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n for (k = 0; k < kLen; k += 1) {\r\n vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;\r\n previousValue.i[j][k] = vertexValue;\r\n vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;\r\n previousValue.o[j][k] = vertexValue;\r\n vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;\r\n previousValue.v[j][k] = vertexValue;\r\n }\r\n }\r\n }\r\n\r\n function interpolateShapeCurrentTime() {\r\n var frameNum = this.comp.renderedFrame - this.offsetTime;\r\n var initTime = this.keyframes[0].t - this.offsetTime;\r\n var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;\r\n var lastFrame = this._caching.lastFrame;\r\n\r\n if (!(lastFrame !== initFrame && (lastFrame < initTime && frameNum < initTime || lastFrame > endTime && frameNum > endTime))) {\r\n /// /\r\n this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;\r\n this.interpolateShape(frameNum, this.pv, this._caching); /// /\r\n }\r\n\r\n this._caching.lastFrame = frameNum;\r\n return this.pv;\r\n }\r\n\r\n function resetShape() {\r\n this.paths = this.localShapeCollection;\r\n }\r\n\r\n function shapesEqual(shape1, shape2) {\r\n if (shape1._length !== shape2._length || shape1.c !== shape2.c) {\r\n return false;\r\n }\r\n\r\n var i;\r\n var len = shape1._length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1] || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1] || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function setVValue(newPath) {\r\n if (!shapesEqual(this.v, newPath)) {\r\n this.v = shapePool.clone(newPath);\r\n this.localShapeCollection.releaseShapes();\r\n this.localShapeCollection.addShape(this.v);\r\n this._mdf = true;\r\n this.paths = this.localShapeCollection;\r\n }\r\n }\r\n\r\n function processEffectsSequence() {\r\n if (this.elem.globalData.frameId === this.frameId) {\r\n return;\r\n }\r\n\r\n if (!this.effectsSequence.length) {\r\n this._mdf = false;\r\n return;\r\n }\r\n\r\n if (this.lock) {\r\n this.setVValue(this.pv);\r\n return;\r\n }\r\n\r\n this.lock = true;\r\n this._mdf = false;\r\n var finalValue;\r\n\r\n if (this.kf) {\r\n finalValue = this.pv;\r\n } else if (this.data.ks) {\r\n finalValue = this.data.ks.k;\r\n } else {\r\n finalValue = this.data.pt.k;\r\n }\r\n\r\n var i;\r\n var len = this.effectsSequence.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n finalValue = this.effectsSequence[i](finalValue);\r\n }\r\n\r\n this.setVValue(finalValue);\r\n this.lock = false;\r\n this.frameId = this.elem.globalData.frameId;\r\n }\r\n\r\n function ShapeProperty(elem, data, type) {\r\n this.propType = 'shape';\r\n this.comp = elem.comp;\r\n this.container = elem;\r\n this.elem = elem;\r\n this.data = data;\r\n this.k = false;\r\n this.kf = false;\r\n this._mdf = false;\r\n var pathData = type === 3 ? data.pt.k : data.ks.k;\r\n this.v = shapePool.clone(pathData);\r\n this.pv = shapePool.clone(this.v);\r\n this.localShapeCollection = shapeCollectionPool.newShapeCollection();\r\n this.paths = this.localShapeCollection;\r\n this.paths.addShape(this.v);\r\n this.reset = resetShape;\r\n this.effectsSequence = [];\r\n }\r\n\r\n function addEffect(effectFunction) {\r\n this.effectsSequence.push(effectFunction);\r\n this.container.addDynamicProperty(this);\r\n }\r\n\r\n ShapeProperty.prototype.interpolateShape = interpolateShape;\r\n ShapeProperty.prototype.getValue = processEffectsSequence;\r\n ShapeProperty.prototype.setVValue = setVValue;\r\n ShapeProperty.prototype.addEffect = addEffect;\r\n\r\n function KeyframedShapeProperty(elem, data, type) {\r\n this.propType = 'shape';\r\n this.comp = elem.comp;\r\n this.elem = elem;\r\n this.container = elem;\r\n this.offsetTime = elem.data.st;\r\n this.keyframes = type === 3 ? data.pt.k : data.ks.k;\r\n this.keyframesMetadata = [];\r\n this.k = true;\r\n this.kf = true;\r\n var len = this.keyframes[0].s[0].i.length;\r\n this.v = shapePool.newElement();\r\n this.v.setPathData(this.keyframes[0].s[0].c, len);\r\n this.pv = shapePool.clone(this.v);\r\n this.localShapeCollection = shapeCollectionPool.newShapeCollection();\r\n this.paths = this.localShapeCollection;\r\n this.paths.addShape(this.v);\r\n this.lastFrame = initFrame;\r\n this.reset = resetShape;\r\n this._caching = {\r\n lastFrame: initFrame,\r\n lastIndex: 0\r\n };\r\n this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];\r\n }\r\n\r\n KeyframedShapeProperty.prototype.getValue = processEffectsSequence;\r\n KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;\r\n KeyframedShapeProperty.prototype.setVValue = setVValue;\r\n KeyframedShapeProperty.prototype.addEffect = addEffect;\r\n\r\n var EllShapeProperty = function () {\r\n var cPoint = roundCorner;\r\n\r\n function EllShapePropertyFactory(elem, data) {\r\n this.v = shapePool.newElement();\r\n this.v.setPathData(true, 4);\r\n this.localShapeCollection = shapeCollectionPool.newShapeCollection();\r\n this.paths = this.localShapeCollection;\r\n this.localShapeCollection.addShape(this.v);\r\n this.d = data.d;\r\n this.elem = elem;\r\n this.comp = elem.comp;\r\n this.frameId = -1;\r\n this.initDynamicPropertyContainer(elem);\r\n this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);\r\n this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);\r\n\r\n if (this.dynamicProperties.length) {\r\n this.k = true;\r\n } else {\r\n this.k = false;\r\n this.convertEllToPath();\r\n }\r\n }\r\n\r\n EllShapePropertyFactory.prototype = {\r\n reset: resetShape,\r\n getValue: function getValue() {\r\n if (this.elem.globalData.frameId === this.frameId) {\r\n return;\r\n }\r\n\r\n this.frameId = this.elem.globalData.frameId;\r\n this.iterateDynamicProperties();\r\n\r\n if (this._mdf) {\r\n this.convertEllToPath();\r\n }\r\n },\r\n convertEllToPath: function convertEllToPath() {\r\n var p0 = this.p.v[0];\r\n var p1 = this.p.v[1];\r\n var s0 = this.s.v[0] / 2;\r\n var s1 = this.s.v[1] / 2;\r\n\r\n var _cw = this.d !== 3;\r\n\r\n var _v = this.v;\r\n _v.v[0][0] = p0;\r\n _v.v[0][1] = p1 - s1;\r\n _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;\r\n _v.v[1][1] = p1;\r\n _v.v[2][0] = p0;\r\n _v.v[2][1] = p1 + s1;\r\n _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;\r\n _v.v[3][1] = p1;\r\n _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;\r\n _v.i[0][1] = p1 - s1;\r\n _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;\r\n _v.i[1][1] = p1 - s1 * cPoint;\r\n _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;\r\n _v.i[2][1] = p1 + s1;\r\n _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;\r\n _v.i[3][1] = p1 + s1 * cPoint;\r\n _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;\r\n _v.o[0][1] = p1 - s1;\r\n _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;\r\n _v.o[1][1] = p1 + s1 * cPoint;\r\n _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;\r\n _v.o[2][1] = p1 + s1;\r\n _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;\r\n _v.o[3][1] = p1 - s1 * cPoint;\r\n }\r\n };\r\n extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);\r\n return EllShapePropertyFactory;\r\n }();\r\n\r\n var StarShapeProperty = function () {\r\n function StarShapePropertyFactory(elem, data) {\r\n this.v = shapePool.newElement();\r\n this.v.setPathData(true, 0);\r\n this.elem = elem;\r\n this.comp = elem.comp;\r\n this.data = data;\r\n this.frameId = -1;\r\n this.d = data.d;\r\n this.initDynamicPropertyContainer(elem);\r\n\r\n if (data.sy === 1) {\r\n this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);\r\n this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);\r\n this.convertToPath = this.convertStarToPath;\r\n } else {\r\n this.convertToPath = this.convertPolygonToPath;\r\n }\r\n\r\n this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);\r\n this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);\r\n this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);\r\n this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);\r\n this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);\r\n this.localShapeCollection = shapeCollectionPool.newShapeCollection();\r\n this.localShapeCollection.addShape(this.v);\r\n this.paths = this.localShapeCollection;\r\n\r\n if (this.dynamicProperties.length) {\r\n this.k = true;\r\n } else {\r\n this.k = false;\r\n this.convertToPath();\r\n }\r\n }\r\n\r\n StarShapePropertyFactory.prototype = {\r\n reset: resetShape,\r\n getValue: function getValue() {\r\n if (this.elem.globalData.frameId === this.frameId) {\r\n return;\r\n }\r\n\r\n this.frameId = this.elem.globalData.frameId;\r\n this.iterateDynamicProperties();\r\n\r\n if (this._mdf) {\r\n this.convertToPath();\r\n }\r\n },\r\n convertStarToPath: function convertStarToPath() {\r\n var numPts = Math.floor(this.pt.v) * 2;\r\n var angle = Math.PI * 2 / numPts;\r\n /* this.v.v.length = numPts;\r\n this.v.i.length = numPts;\r\n this.v.o.length = numPts; */\r\n\r\n var longFlag = true;\r\n var longRad = this.or.v;\r\n var shortRad = this.ir.v;\r\n var longRound = this.os.v;\r\n var shortRound = this.is.v;\r\n var longPerimSegment = 2 * Math.PI * longRad / (numPts * 2);\r\n var shortPerimSegment = 2 * Math.PI * shortRad / (numPts * 2);\r\n var i;\r\n var rad;\r\n var roundness;\r\n var perimSegment;\r\n var currentAng = -Math.PI / 2;\r\n currentAng += this.r.v;\r\n var dir = this.data.d === 3 ? -1 : 1;\r\n this.v._length = 0;\r\n\r\n for (i = 0; i < numPts; i += 1) {\r\n rad = longFlag ? longRad : shortRad;\r\n roundness = longFlag ? longRound : shortRound;\r\n perimSegment = longFlag ? longPerimSegment : shortPerimSegment;\r\n var x = rad * Math.cos(currentAng);\r\n var y = rad * Math.sin(currentAng);\r\n var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);\r\n var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);\r\n x += +this.p.v[0];\r\n y += +this.p.v[1];\r\n this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true);\r\n /* this.v.v[i] = [x,y];\r\n this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];\r\n this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];\r\n this.v._length = numPts; */\r\n\r\n longFlag = !longFlag;\r\n currentAng += angle * dir;\r\n }\r\n },\r\n convertPolygonToPath: function convertPolygonToPath() {\r\n var numPts = Math.floor(this.pt.v);\r\n var angle = Math.PI * 2 / numPts;\r\n var rad = this.or.v;\r\n var roundness = this.os.v;\r\n var perimSegment = 2 * Math.PI * rad / (numPts * 4);\r\n var i;\r\n var currentAng = -Math.PI * 0.5;\r\n var dir = this.data.d === 3 ? -1 : 1;\r\n currentAng += this.r.v;\r\n this.v._length = 0;\r\n\r\n for (i = 0; i < numPts; i += 1) {\r\n var x = rad * Math.cos(currentAng);\r\n var y = rad * Math.sin(currentAng);\r\n var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);\r\n var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);\r\n x += +this.p.v[0];\r\n y += +this.p.v[1];\r\n this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true);\r\n currentAng += angle * dir;\r\n }\r\n\r\n this.paths.length = 0;\r\n this.paths[0] = this.v;\r\n }\r\n };\r\n extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);\r\n return StarShapePropertyFactory;\r\n }();\r\n\r\n var RectShapeProperty = function () {\r\n function RectShapePropertyFactory(elem, data) {\r\n this.v = shapePool.newElement();\r\n this.v.c = true;\r\n this.localShapeCollection = shapeCollectionPool.newShapeCollection();\r\n this.localShapeCollection.addShape(this.v);\r\n this.paths = this.localShapeCollection;\r\n this.elem = elem;\r\n this.comp = elem.comp;\r\n this.frameId = -1;\r\n this.d = data.d;\r\n this.initDynamicPropertyContainer(elem);\r\n this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);\r\n this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);\r\n this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);\r\n\r\n if (this.dynamicProperties.length) {\r\n this.k = true;\r\n } else {\r\n this.k = false;\r\n this.convertRectToPath();\r\n }\r\n }\r\n\r\n RectShapePropertyFactory.prototype = {\r\n convertRectToPath: function convertRectToPath() {\r\n var p0 = this.p.v[0];\r\n var p1 = this.p.v[1];\r\n var v0 = this.s.v[0] / 2;\r\n var v1 = this.s.v[1] / 2;\r\n var round = bmMin(v0, v1, this.r.v);\r\n var cPoint = round * (1 - roundCorner);\r\n this.v._length = 0;\r\n\r\n if (this.d === 2 || this.d === 1) {\r\n this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);\r\n this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);\r\n\r\n if (round !== 0) {\r\n this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);\r\n this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);\r\n this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);\r\n this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);\r\n this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);\r\n this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);\r\n } else {\r\n this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);\r\n this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);\r\n }\r\n } else {\r\n this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);\r\n\r\n if (round !== 0) {\r\n this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);\r\n this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);\r\n this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);\r\n this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);\r\n this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);\r\n this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);\r\n this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);\r\n } else {\r\n this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);\r\n this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);\r\n this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);\r\n }\r\n }\r\n },\r\n getValue: function getValue() {\r\n if (this.elem.globalData.frameId === this.frameId) {\r\n return;\r\n }\r\n\r\n this.frameId = this.elem.globalData.frameId;\r\n this.iterateDynamicProperties();\r\n\r\n if (this._mdf) {\r\n this.convertRectToPath();\r\n }\r\n },\r\n reset: resetShape\r\n };\r\n extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);\r\n return RectShapePropertyFactory;\r\n }();\r\n\r\n function getShapeProp(elem, data, type) {\r\n var prop;\r\n\r\n if (type === 3 || type === 4) {\r\n var dataProp = type === 3 ? data.pt : data.ks;\r\n var keys = dataProp.k;\r\n\r\n if (keys.length) {\r\n prop = new KeyframedShapeProperty(elem, data, type);\r\n } else {\r\n prop = new ShapeProperty(elem, data, type);\r\n }\r\n } else if (type === 5) {\r\n prop = new RectShapeProperty(elem, data);\r\n } else if (type === 6) {\r\n prop = new EllShapeProperty(elem, data);\r\n } else if (type === 7) {\r\n prop = new StarShapeProperty(elem, data);\r\n }\r\n\r\n if (prop.k) {\r\n elem.addDynamicProperty(prop);\r\n }\r\n\r\n return prop;\r\n }\r\n\r\n function getConstructorFunction() {\r\n return ShapeProperty;\r\n }\r\n\r\n function getKeyframedConstructorFunction() {\r\n return KeyframedShapeProperty;\r\n }\r\n\r\n var ob = {};\r\n ob.getShapeProp = getShapeProp;\r\n ob.getConstructorFunction = getConstructorFunction;\r\n ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;\r\n return ob;\r\n }();\r\n\r\n /*!\r\n Transformation Matrix v2.0\r\n (c) Epistemex 2014-2015\r\n www.epistemex.com\r\n By Ken Fyrstenberg\r\n Contributions by leeoniya.\r\n License: MIT, header required.\r\n */\r\n\r\n /**\r\n * 2D transformation matrix object initialized with identity matrix.\r\n *\r\n * The matrix can synchronize a canvas context by supplying the context\r\n * as an argument, or later apply current absolute transform to an\r\n * existing context.\r\n *\r\n * All values are handled as floating point values.\r\n *\r\n * @param {CanvasRenderingContext2D} [context] - Optional context to sync with Matrix\r\n * @prop {number} a - scale x\r\n * @prop {number} b - shear y\r\n * @prop {number} c - shear x\r\n * @prop {number} d - scale y\r\n * @prop {number} e - translate x\r\n * @prop {number} f - translate y\r\n * @prop {CanvasRenderingContext2D|null} [context=null] - set or get current canvas context\r\n * @constructor\r\n */\r\n\r\n var Matrix = function () {\r\n var _cos = Math.cos;\r\n var _sin = Math.sin;\r\n var _tan = Math.tan;\r\n var _rnd = Math.round;\r\n\r\n function reset() {\r\n this.props[0] = 1;\r\n this.props[1] = 0;\r\n this.props[2] = 0;\r\n this.props[3] = 0;\r\n this.props[4] = 0;\r\n this.props[5] = 1;\r\n this.props[6] = 0;\r\n this.props[7] = 0;\r\n this.props[8] = 0;\r\n this.props[9] = 0;\r\n this.props[10] = 1;\r\n this.props[11] = 0;\r\n this.props[12] = 0;\r\n this.props[13] = 0;\r\n this.props[14] = 0;\r\n this.props[15] = 1;\r\n return this;\r\n }\r\n\r\n function rotate(angle) {\r\n if (angle === 0) {\r\n return this;\r\n }\r\n\r\n var mCos = _cos(angle);\r\n\r\n var mSin = _sin(angle);\r\n\r\n return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\r\n }\r\n\r\n function rotateX(angle) {\r\n if (angle === 0) {\r\n return this;\r\n }\r\n\r\n var mCos = _cos(angle);\r\n\r\n var mSin = _sin(angle);\r\n\r\n return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);\r\n }\r\n\r\n function rotateY(angle) {\r\n if (angle === 0) {\r\n return this;\r\n }\r\n\r\n var mCos = _cos(angle);\r\n\r\n var mSin = _sin(angle);\r\n\r\n return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);\r\n }\r\n\r\n function rotateZ(angle) {\r\n if (angle === 0) {\r\n return this;\r\n }\r\n\r\n var mCos = _cos(angle);\r\n\r\n var mSin = _sin(angle);\r\n\r\n return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\r\n }\r\n\r\n function shear(sx, sy) {\r\n return this._t(1, sy, sx, 1, 0, 0);\r\n }\r\n\r\n function skew(ax, ay) {\r\n return this.shear(_tan(ax), _tan(ay));\r\n }\r\n\r\n function skewFromAxis(ax, angle) {\r\n var mCos = _cos(angle);\r\n\r\n var mSin = _sin(angle);\r\n\r\n return this._t(mCos, mSin, 0, 0, -mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(1, 0, 0, 0, _tan(ax), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); // return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, _tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);\r\n }\r\n\r\n function scale(sx, sy, sz) {\r\n if (!sz && sz !== 0) {\r\n sz = 1;\r\n }\r\n\r\n if (sx === 1 && sy === 1 && sz === 1) {\r\n return this;\r\n }\r\n\r\n return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);\r\n }\r\n\r\n function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {\r\n this.props[0] = a;\r\n this.props[1] = b;\r\n this.props[2] = c;\r\n this.props[3] = d;\r\n this.props[4] = e;\r\n this.props[5] = f;\r\n this.props[6] = g;\r\n this.props[7] = h;\r\n this.props[8] = i;\r\n this.props[9] = j;\r\n this.props[10] = k;\r\n this.props[11] = l;\r\n this.props[12] = m;\r\n this.props[13] = n;\r\n this.props[14] = o;\r\n this.props[15] = p;\r\n return this;\r\n }\r\n\r\n function translate(tx, ty, tz) {\r\n tz = tz || 0;\r\n\r\n if (tx !== 0 || ty !== 0 || tz !== 0) {\r\n return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {\r\n var _p = this.props;\r\n\r\n if (a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0) {\r\n // NOTE: commenting this condition because TurboFan deoptimizes code when present\r\n // if(m2 !== 0 || n2 !== 0 || o2 !== 0){\r\n _p[12] = _p[12] * a2 + _p[15] * m2;\r\n _p[13] = _p[13] * f2 + _p[15] * n2;\r\n _p[14] = _p[14] * k2 + _p[15] * o2;\r\n _p[15] *= p2; // }\r\n\r\n this._identityCalculated = false;\r\n return this;\r\n }\r\n\r\n var a1 = _p[0];\r\n var b1 = _p[1];\r\n var c1 = _p[2];\r\n var d1 = _p[3];\r\n var e1 = _p[4];\r\n var f1 = _p[5];\r\n var g1 = _p[6];\r\n var h1 = _p[7];\r\n var i1 = _p[8];\r\n var j1 = _p[9];\r\n var k1 = _p[10];\r\n var l1 = _p[11];\r\n var m1 = _p[12];\r\n var n1 = _p[13];\r\n var o1 = _p[14];\r\n var p1 = _p[15];\r\n /* matrix order (canvas compatible):\r\n * ace\r\n * bdf\r\n * 001\r\n */\r\n\r\n _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;\r\n _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;\r\n _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;\r\n _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;\r\n _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;\r\n _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;\r\n _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;\r\n _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;\r\n _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;\r\n _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;\r\n _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;\r\n _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;\r\n _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;\r\n _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;\r\n _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;\r\n _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;\r\n this._identityCalculated = false;\r\n return this;\r\n }\r\n\r\n function isIdentity() {\r\n if (!this._identityCalculated) {\r\n this._identity = !(this.props[0] !== 1 || this.props[1] !== 0 || this.props[2] !== 0 || this.props[3] !== 0 || this.props[4] !== 0 || this.props[5] !== 1 || this.props[6] !== 0 || this.props[7] !== 0 || this.props[8] !== 0 || this.props[9] !== 0 || this.props[10] !== 1 || this.props[11] !== 0 || this.props[12] !== 0 || this.props[13] !== 0 || this.props[14] !== 0 || this.props[15] !== 1);\r\n this._identityCalculated = true;\r\n }\r\n\r\n return this._identity;\r\n }\r\n\r\n function equals(matr) {\r\n var i = 0;\r\n\r\n while (i < 16) {\r\n if (matr.props[i] !== this.props[i]) {\r\n return false;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function clone(matr) {\r\n var i;\r\n\r\n for (i = 0; i < 16; i += 1) {\r\n matr.props[i] = this.props[i];\r\n }\r\n\r\n return matr;\r\n }\r\n\r\n function cloneFromProps(props) {\r\n var i;\r\n\r\n for (i = 0; i < 16; i += 1) {\r\n this.props[i] = props[i];\r\n }\r\n }\r\n\r\n function applyToPoint(x, y, z) {\r\n return {\r\n x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],\r\n y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],\r\n z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]\r\n };\r\n /* return {\r\n x: x * me.a + y * me.c + me.e,\r\n y: x * me.b + y * me.d + me.f\r\n }; */\r\n }\r\n\r\n function applyToX(x, y, z) {\r\n return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];\r\n }\r\n\r\n function applyToY(x, y, z) {\r\n return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];\r\n }\r\n\r\n function applyToZ(x, y, z) {\r\n return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];\r\n }\r\n\r\n function getInverseMatrix() {\r\n var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];\r\n var a = this.props[5] / determinant;\r\n var b = -this.props[1] / determinant;\r\n var c = -this.props[4] / determinant;\r\n var d = this.props[0] / determinant;\r\n var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;\r\n var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;\r\n var inverseMatrix = new Matrix();\r\n inverseMatrix.props[0] = a;\r\n inverseMatrix.props[1] = b;\r\n inverseMatrix.props[4] = c;\r\n inverseMatrix.props[5] = d;\r\n inverseMatrix.props[12] = e;\r\n inverseMatrix.props[13] = f;\r\n return inverseMatrix;\r\n }\r\n\r\n function inversePoint(pt) {\r\n var inverseMatrix = this.getInverseMatrix();\r\n return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);\r\n }\r\n\r\n function inversePoints(pts) {\r\n var i;\r\n var len = pts.length;\r\n var retPts = [];\r\n\r\n for (i = 0; i < len; i += 1) {\r\n retPts[i] = inversePoint(pts[i]);\r\n }\r\n\r\n return retPts;\r\n }\r\n\r\n function applyToTriplePoints(pt1, pt2, pt3) {\r\n var arr = createTypedArray('float32', 6);\r\n\r\n if (this.isIdentity()) {\r\n arr[0] = pt1[0];\r\n arr[1] = pt1[1];\r\n arr[2] = pt2[0];\r\n arr[3] = pt2[1];\r\n arr[4] = pt3[0];\r\n arr[5] = pt3[1];\r\n } else {\r\n var p0 = this.props[0];\r\n var p1 = this.props[1];\r\n var p4 = this.props[4];\r\n var p5 = this.props[5];\r\n var p12 = this.props[12];\r\n var p13 = this.props[13];\r\n arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;\r\n arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;\r\n arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;\r\n arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;\r\n arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;\r\n arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n function applyToPointArray(x, y, z) {\r\n var arr;\r\n\r\n if (this.isIdentity()) {\r\n arr = [x, y, z];\r\n } else {\r\n arr = [x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12], x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13], x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]];\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n function applyToPointStringified(x, y) {\r\n if (this.isIdentity()) {\r\n return x + ',' + y;\r\n }\r\n\r\n var _p = this.props;\r\n return Math.round((x * _p[0] + y * _p[4] + _p[12]) * 100) / 100 + ',' + Math.round((x * _p[1] + y * _p[5] + _p[13]) * 100) / 100;\r\n }\r\n\r\n function toCSS() {\r\n // Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.\r\n\r\n /* if(this.isIdentity()) {\r\n return '';\r\n } */\r\n var i = 0;\r\n var props = this.props;\r\n var cssValue = 'matrix3d(';\r\n var v = 10000;\r\n\r\n while (i < 16) {\r\n cssValue += _rnd(props[i] * v) / v;\r\n cssValue += i === 15 ? ')' : ',';\r\n i += 1;\r\n }\r\n\r\n return cssValue;\r\n }\r\n\r\n function roundMatrixProperty(val) {\r\n var v = 10000;\r\n\r\n if (val < 0.000001 && val > 0 || val > -0.000001 && val < 0) {\r\n return _rnd(val * v) / v;\r\n }\r\n\r\n return val;\r\n }\r\n\r\n function to2dCSS() {\r\n // Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.\r\n\r\n /* if(this.isIdentity()) {\r\n return '';\r\n } */\r\n var props = this.props;\r\n\r\n var _a = roundMatrixProperty(props[0]);\r\n\r\n var _b = roundMatrixProperty(props[1]);\r\n\r\n var _c = roundMatrixProperty(props[4]);\r\n\r\n var _d = roundMatrixProperty(props[5]);\r\n\r\n var _e = roundMatrixProperty(props[12]);\r\n\r\n var _f = roundMatrixProperty(props[13]);\r\n\r\n return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';\r\n }\r\n\r\n return function () {\r\n this.reset = reset;\r\n this.rotate = rotate;\r\n this.rotateX = rotateX;\r\n this.rotateY = rotateY;\r\n this.rotateZ = rotateZ;\r\n this.skew = skew;\r\n this.skewFromAxis = skewFromAxis;\r\n this.shear = shear;\r\n this.scale = scale;\r\n this.setTransform = setTransform;\r\n this.translate = translate;\r\n this.transform = transform;\r\n this.applyToPoint = applyToPoint;\r\n this.applyToX = applyToX;\r\n this.applyToY = applyToY;\r\n this.applyToZ = applyToZ;\r\n this.applyToPointArray = applyToPointArray;\r\n this.applyToTriplePoints = applyToTriplePoints;\r\n this.applyToPointStringified = applyToPointStringified;\r\n this.toCSS = toCSS;\r\n this.to2dCSS = to2dCSS;\r\n this.clone = clone;\r\n this.cloneFromProps = cloneFromProps;\r\n this.equals = equals;\r\n this.inversePoints = inversePoints;\r\n this.inversePoint = inversePoint;\r\n this.getInverseMatrix = getInverseMatrix;\r\n this._t = this.transform;\r\n this.isIdentity = isIdentity;\r\n this._identity = true;\r\n this._identityCalculated = false;\r\n this.props = createTypedArray('float32', 16);\r\n this.reset();\r\n };\r\n }();\r\n\r\n function _typeof$3(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$3(obj); }\r\n var lottie = {};\r\n var standalone = '__[STANDALONE]__';\r\n var animationData = '__[ANIMATIONDATA]__';\r\n var renderer = '';\r\n\r\n function setLocation(href) {\r\n setLocationHref(href);\r\n }\r\n\r\n function searchAnimations() {\r\n if (standalone === true) {\r\n animationManager.searchAnimations(animationData, standalone, renderer);\r\n } else {\r\n animationManager.searchAnimations();\r\n }\r\n }\r\n\r\n function setSubframeRendering(flag) {\r\n setSubframeEnabled(flag);\r\n }\r\n\r\n function setPrefix(prefix) {\r\n setIdPrefix(prefix);\r\n }\r\n\r\n function loadAnimation(params) {\r\n if (standalone === true) {\r\n params.animationData = JSON.parse(animationData);\r\n }\r\n\r\n return animationManager.loadAnimation(params);\r\n }\r\n\r\n function setQuality(value) {\r\n if (typeof value === 'string') {\r\n switch (value) {\r\n case 'high':\r\n setDefaultCurveSegments(200);\r\n break;\r\n\r\n default:\r\n case 'medium':\r\n setDefaultCurveSegments(50);\r\n break;\r\n\r\n case 'low':\r\n setDefaultCurveSegments(10);\r\n break;\r\n }\r\n } else if (!isNaN(value) && value > 1) {\r\n setDefaultCurveSegments(value);\r\n }\r\n\r\n if (getDefaultCurveSegments() >= 50) {\r\n roundValues(false);\r\n } else {\r\n roundValues(true);\r\n }\r\n }\r\n\r\n function inBrowser() {\r\n return typeof navigator !== 'undefined';\r\n }\r\n\r\n function installPlugin(type, plugin) {\r\n if (type === 'expressions') {\r\n setExpressionsPlugin(plugin);\r\n }\r\n }\r\n\r\n function getFactory(name) {\r\n switch (name) {\r\n case 'propertyFactory':\r\n return PropertyFactory;\r\n\r\n case 'shapePropertyFactory':\r\n return ShapePropertyFactory;\r\n\r\n case 'matrix':\r\n return Matrix;\r\n\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n lottie.play = animationManager.play;\r\n lottie.pause = animationManager.pause;\r\n lottie.setLocationHref = setLocation;\r\n lottie.togglePause = animationManager.togglePause;\r\n lottie.setSpeed = animationManager.setSpeed;\r\n lottie.setDirection = animationManager.setDirection;\r\n lottie.stop = animationManager.stop;\r\n lottie.searchAnimations = searchAnimations;\r\n lottie.registerAnimation = animationManager.registerAnimation;\r\n lottie.loadAnimation = loadAnimation;\r\n lottie.setSubframeRendering = setSubframeRendering;\r\n lottie.resize = animationManager.resize; // lottie.start = start;\r\n\r\n lottie.goToAndStop = animationManager.goToAndStop;\r\n lottie.destroy = animationManager.destroy;\r\n lottie.setQuality = setQuality;\r\n lottie.inBrowser = inBrowser;\r\n lottie.installPlugin = installPlugin;\r\n lottie.freeze = animationManager.freeze;\r\n lottie.unfreeze = animationManager.unfreeze;\r\n lottie.setVolume = animationManager.setVolume;\r\n lottie.mute = animationManager.mute;\r\n lottie.unmute = animationManager.unmute;\r\n lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;\r\n lottie.useWebWorker = setWebWorker;\r\n lottie.setIDPrefix = setPrefix;\r\n lottie.__getFactory = getFactory;\r\n lottie.version = '5.10.2';\r\n\r\n function checkReady() {\r\n if (document.readyState === 'complete') {\r\n clearInterval(readyStateCheckInterval);\r\n searchAnimations();\r\n }\r\n }\r\n\r\n function getQueryVariable(variable) {\r\n var vars = queryString.split('&');\r\n\r\n for (var i = 0; i < vars.length; i += 1) {\r\n var pair = vars[i].split('=');\r\n\r\n if (decodeURIComponent(pair[0]) == variable) {\r\n // eslint-disable-line eqeqeq\r\n return decodeURIComponent(pair[1]);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var queryString = '';\r\n\r\n if (standalone) {\r\n var scripts = document.getElementsByTagName('script');\r\n var index = scripts.length - 1;\r\n var myScript = scripts[index] || {\r\n src: ''\r\n };\r\n queryString = myScript.src ? myScript.src.replace(/^[^\\?]+\\??/, '') : ''; // eslint-disable-line no-useless-escape\r\n\r\n renderer = getQueryVariable('renderer');\r\n }\r\n\r\n var readyStateCheckInterval = setInterval(checkReady, 100); // this adds bodymovin to the window object for backwards compatibility\r\n\r\n try {\r\n if (!((typeof exports === \"undefined\" ? \"undefined\" : _typeof$3(exports)) === 'object' && typeof module !== 'undefined') && !(typeof define === 'function' && define.amd) // eslint-disable-line no-undef\r\n ) {\r\n window.bodymovin = lottie;\r\n }\r\n } catch (err) {//\r\n }\r\n\r\n var ShapeModifiers = function () {\r\n var ob = {};\r\n var modifiers = {};\r\n ob.registerModifier = registerModifier;\r\n ob.getModifier = getModifier;\r\n\r\n function registerModifier(nm, factory) {\r\n if (!modifiers[nm]) {\r\n modifiers[nm] = factory;\r\n }\r\n }\r\n\r\n function getModifier(nm, elem, data) {\r\n return new modifiers[nm](elem, data);\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n function ShapeModifier() {}\r\n\r\n ShapeModifier.prototype.initModifierProperties = function () {};\r\n\r\n ShapeModifier.prototype.addShapeToModifier = function () {};\r\n\r\n ShapeModifier.prototype.addShape = function (data) {\r\n if (!this.closed) {\r\n // Adding shape to dynamic properties. It covers the case where a shape has no effects applied, to reset it's _mdf state on every tick.\r\n data.sh.container.addDynamicProperty(data.sh);\r\n var shapeData = {\r\n shape: data.sh,\r\n data: data,\r\n localShapeCollection: shapeCollectionPool.newShapeCollection()\r\n };\r\n this.shapes.push(shapeData);\r\n this.addShapeToModifier(shapeData);\r\n\r\n if (this._isAnimated) {\r\n data.setAsAnimated();\r\n }\r\n }\r\n };\r\n\r\n ShapeModifier.prototype.init = function (elem, data) {\r\n this.shapes = [];\r\n this.elem = elem;\r\n this.initDynamicPropertyContainer(elem);\r\n this.initModifierProperties(elem, data);\r\n this.frameId = initialDefaultFrame;\r\n this.closed = false;\r\n this.k = false;\r\n\r\n if (this.dynamicProperties.length) {\r\n this.k = true;\r\n } else {\r\n this.getValue(true);\r\n }\r\n };\r\n\r\n ShapeModifier.prototype.processKeys = function () {\r\n if (this.elem.globalData.frameId === this.frameId) {\r\n return;\r\n }\r\n\r\n this.frameId = this.elem.globalData.frameId;\r\n this.iterateDynamicProperties();\r\n };\r\n\r\n extendPrototype([DynamicPropertyContainer], ShapeModifier);\r\n\r\n function TrimModifier() {}\r\n\r\n extendPrototype([ShapeModifier], TrimModifier);\r\n\r\n TrimModifier.prototype.initModifierProperties = function (elem, data) {\r\n this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);\r\n this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);\r\n this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);\r\n this.sValue = 0;\r\n this.eValue = 0;\r\n this.getValue = this.processKeys;\r\n this.m = data.m;\r\n this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;\r\n };\r\n\r\n TrimModifier.prototype.addShapeToModifier = function (shapeData) {\r\n shapeData.pathsData = [];\r\n };\r\n\r\n TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {\r\n var segments = [];\r\n\r\n if (e <= 1) {\r\n segments.push({\r\n s: s,\r\n e: e\r\n });\r\n } else if (s >= 1) {\r\n segments.push({\r\n s: s - 1,\r\n e: e - 1\r\n });\r\n } else {\r\n segments.push({\r\n s: s,\r\n e: 1\r\n });\r\n segments.push({\r\n s: 0,\r\n e: e - 1\r\n });\r\n }\r\n\r\n var shapeSegments = [];\r\n var i;\r\n var len = segments.length;\r\n var segmentOb;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n segmentOb = segments[i];\r\n\r\n if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {\r\n var shapeS;\r\n var shapeE;\r\n\r\n if (segmentOb.s * totalModifierLength <= addedLength) {\r\n shapeS = 0;\r\n } else {\r\n shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;\r\n }\r\n\r\n if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {\r\n shapeE = 1;\r\n } else {\r\n shapeE = (segmentOb.e * totalModifierLength - addedLength) / shapeLength;\r\n }\r\n\r\n shapeSegments.push([shapeS, shapeE]);\r\n }\r\n }\r\n\r\n if (!shapeSegments.length) {\r\n shapeSegments.push([0, 0]);\r\n }\r\n\r\n return shapeSegments;\r\n };\r\n\r\n TrimModifier.prototype.releasePathsData = function (pathsData) {\r\n var i;\r\n var len = pathsData.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n segmentsLengthPool.release(pathsData[i]);\r\n }\r\n\r\n pathsData.length = 0;\r\n return pathsData;\r\n };\r\n\r\n TrimModifier.prototype.processShapes = function (_isFirstFrame) {\r\n var s;\r\n var e;\r\n\r\n if (this._mdf || _isFirstFrame) {\r\n var o = this.o.v % 360 / 360;\r\n\r\n if (o < 0) {\r\n o += 1;\r\n }\r\n\r\n if (this.s.v > 1) {\r\n s = 1 + o;\r\n } else if (this.s.v < 0) {\r\n s = 0 + o;\r\n } else {\r\n s = this.s.v + o;\r\n }\r\n\r\n if (this.e.v > 1) {\r\n e = 1 + o;\r\n } else if (this.e.v < 0) {\r\n e = 0 + o;\r\n } else {\r\n e = this.e.v + o;\r\n }\r\n\r\n if (s > e) {\r\n var _s = s;\r\n s = e;\r\n e = _s;\r\n }\r\n\r\n s = Math.round(s * 10000) * 0.0001;\r\n e = Math.round(e * 10000) * 0.0001;\r\n this.sValue = s;\r\n this.eValue = e;\r\n } else {\r\n s = this.sValue;\r\n e = this.eValue;\r\n }\r\n\r\n var shapePaths;\r\n var i;\r\n var len = this.shapes.length;\r\n var j;\r\n var jLen;\r\n var pathsData;\r\n var pathData;\r\n var totalShapeLength;\r\n var totalModifierLength = 0;\r\n\r\n if (e === s) {\r\n for (i = 0; i < len; i += 1) {\r\n this.shapes[i].localShapeCollection.releaseShapes();\r\n this.shapes[i].shape._mdf = true;\r\n this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;\r\n\r\n if (this._mdf) {\r\n this.shapes[i].pathsData.length = 0;\r\n }\r\n }\r\n } else if (!(e === 1 && s === 0 || e === 0 && s === 1)) {\r\n var segments = [];\r\n var shapeData;\r\n var localShapeCollection;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapeData = this.shapes[i]; // if shape hasn't changed and trim properties haven't changed, cached previous path can be used\r\n\r\n if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {\r\n shapeData.shape.paths = shapeData.localShapeCollection;\r\n } else {\r\n shapePaths = shapeData.shape.paths;\r\n jLen = shapePaths._length;\r\n totalShapeLength = 0;\r\n\r\n if (!shapeData.shape._mdf && shapeData.pathsData.length) {\r\n totalShapeLength = shapeData.totalShapeLength;\r\n } else {\r\n pathsData = this.releasePathsData(shapeData.pathsData);\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n pathData = bez.getSegmentsLength(shapePaths.shapes[j]);\r\n pathsData.push(pathData);\r\n totalShapeLength += pathData.totalLength;\r\n }\r\n\r\n shapeData.totalShapeLength = totalShapeLength;\r\n shapeData.pathsData = pathsData;\r\n }\r\n\r\n totalModifierLength += totalShapeLength;\r\n shapeData.shape._mdf = true;\r\n }\r\n }\r\n\r\n var shapeS = s;\r\n var shapeE = e;\r\n var addedLength = 0;\r\n var edges;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n shapeData = this.shapes[i];\r\n\r\n if (shapeData.shape._mdf) {\r\n localShapeCollection = shapeData.localShapeCollection;\r\n localShapeCollection.releaseShapes(); // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group\r\n\r\n if (this.m === 2 && len > 1) {\r\n edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);\r\n addedLength += shapeData.totalShapeLength;\r\n } else {\r\n edges = [[shapeS, shapeE]];\r\n }\r\n\r\n jLen = edges.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n shapeS = edges[j][0];\r\n shapeE = edges[j][1];\r\n segments.length = 0;\r\n\r\n if (shapeE <= 1) {\r\n segments.push({\r\n s: shapeData.totalShapeLength * shapeS,\r\n e: shapeData.totalShapeLength * shapeE\r\n });\r\n } else if (shapeS >= 1) {\r\n segments.push({\r\n s: shapeData.totalShapeLength * (shapeS - 1),\r\n e: shapeData.totalShapeLength * (shapeE - 1)\r\n });\r\n } else {\r\n segments.push({\r\n s: shapeData.totalShapeLength * shapeS,\r\n e: shapeData.totalShapeLength\r\n });\r\n segments.push({\r\n s: 0,\r\n e: shapeData.totalShapeLength * (shapeE - 1)\r\n });\r\n }\r\n\r\n var newShapesData = this.addShapes(shapeData, segments[0]);\r\n\r\n if (segments[0].s !== segments[0].e) {\r\n if (segments.length > 1) {\r\n var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];\r\n\r\n if (lastShapeInCollection.c) {\r\n var lastShape = newShapesData.pop();\r\n this.addPaths(newShapesData, localShapeCollection);\r\n newShapesData = this.addShapes(shapeData, segments[1], lastShape);\r\n } else {\r\n this.addPaths(newShapesData, localShapeCollection);\r\n newShapesData = this.addShapes(shapeData, segments[1]);\r\n }\r\n }\r\n\r\n this.addPaths(newShapesData, localShapeCollection);\r\n }\r\n }\r\n\r\n shapeData.shape.paths = localShapeCollection;\r\n }\r\n }\r\n } else if (this._mdf) {\r\n for (i = 0; i < len; i += 1) {\r\n // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.\r\n // Don't remove this even if it's losing cached info.\r\n this.shapes[i].pathsData.length = 0;\r\n this.shapes[i].shape._mdf = true;\r\n }\r\n }\r\n };\r\n\r\n TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {\r\n var i;\r\n var len = newPaths.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n localShapeCollection.addShape(newPaths[i]);\r\n }\r\n };\r\n\r\n TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {\r\n shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);\r\n shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);\r\n\r\n if (newShape) {\r\n shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);\r\n }\r\n\r\n shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);\r\n };\r\n\r\n TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {\r\n shapePath.setXYAt(points[1], points[5], 'o', pos);\r\n shapePath.setXYAt(points[2], points[6], 'i', pos + 1);\r\n\r\n if (newShape) {\r\n shapePath.setXYAt(points[0], points[4], 'v', pos);\r\n }\r\n\r\n shapePath.setXYAt(points[3], points[7], 'v', pos + 1);\r\n };\r\n\r\n TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {\r\n var pathsData = shapeData.pathsData;\r\n var shapePaths = shapeData.shape.paths.shapes;\r\n var i;\r\n var len = shapeData.shape.paths._length;\r\n var j;\r\n var jLen;\r\n var addedLength = 0;\r\n var currentLengthData;\r\n var segmentCount;\r\n var lengths;\r\n var segment;\r\n var shapes = [];\r\n var initPos;\r\n var newShape = true;\r\n\r\n if (!shapePath) {\r\n shapePath = shapePool.newElement();\r\n segmentCount = 0;\r\n initPos = 0;\r\n } else {\r\n segmentCount = shapePath._length;\r\n initPos = shapePath._length;\r\n }\r\n\r\n shapes.push(shapePath);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n lengths = pathsData[i].lengths;\r\n shapePath.c = shapePaths[i].c;\r\n jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;\r\n\r\n for (j = 1; j < jLen; j += 1) {\r\n currentLengthData = lengths[j - 1];\r\n\r\n if (addedLength + currentLengthData.addedLength < shapeSegment.s) {\r\n addedLength += currentLengthData.addedLength;\r\n shapePath.c = false;\r\n } else if (addedLength > shapeSegment.e) {\r\n shapePath.c = false;\r\n break;\r\n } else {\r\n if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {\r\n this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);\r\n newShape = false;\r\n } else {\r\n segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[j], shapePaths[i].o[j - 1], shapePaths[i].i[j], (shapeSegment.s - addedLength) / currentLengthData.addedLength, (shapeSegment.e - addedLength) / currentLengthData.addedLength, lengths[j - 1]);\r\n this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);\r\n\r\n newShape = false;\r\n shapePath.c = false;\r\n }\r\n\r\n addedLength += currentLengthData.addedLength;\r\n segmentCount += 1;\r\n }\r\n }\r\n\r\n if (shapePaths[i].c && lengths.length) {\r\n currentLengthData = lengths[j - 1];\r\n\r\n if (addedLength <= shapeSegment.e) {\r\n var segmentLength = lengths[j - 1].addedLength;\r\n\r\n if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {\r\n this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);\r\n newShape = false;\r\n } else {\r\n segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[0], shapePaths[i].o[j - 1], shapePaths[i].i[0], (shapeSegment.s - addedLength) / segmentLength, (shapeSegment.e - addedLength) / segmentLength, lengths[j - 1]);\r\n this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);\r\n\r\n newShape = false;\r\n shapePath.c = false;\r\n }\r\n } else {\r\n shapePath.c = false;\r\n }\r\n\r\n addedLength += currentLengthData.addedLength;\r\n segmentCount += 1;\r\n }\r\n\r\n if (shapePath._length) {\r\n shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);\r\n shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);\r\n }\r\n\r\n if (addedLength > shapeSegment.e) {\r\n break;\r\n }\r\n\r\n if (i < len - 1) {\r\n shapePath = shapePool.newElement();\r\n newShape = true;\r\n shapes.push(shapePath);\r\n segmentCount = 0;\r\n }\r\n }\r\n\r\n return shapes;\r\n };\r\n\r\n function PuckerAndBloatModifier() {}\r\n\r\n extendPrototype([ShapeModifier], PuckerAndBloatModifier);\r\n\r\n PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {\r\n this.getValue = this.processKeys;\r\n this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);\r\n this._isAnimated = !!this.amount.effectsSequence.length;\r\n };\r\n\r\n PuckerAndBloatModifier.prototype.processPath = function (path, amount) {\r\n var percent = amount / 100;\r\n var centerPoint = [0, 0];\r\n var pathLength = path._length;\r\n var i = 0;\r\n\r\n for (i = 0; i < pathLength; i += 1) {\r\n centerPoint[0] += path.v[i][0];\r\n centerPoint[1] += path.v[i][1];\r\n }\r\n\r\n centerPoint[0] /= pathLength;\r\n centerPoint[1] /= pathLength;\r\n var clonedPath = shapePool.newElement();\r\n clonedPath.c = path.c;\r\n var vX;\r\n var vY;\r\n var oX;\r\n var oY;\r\n var iX;\r\n var iY;\r\n\r\n for (i = 0; i < pathLength; i += 1) {\r\n vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;\r\n vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;\r\n oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;\r\n oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;\r\n iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;\r\n iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;\r\n clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);\r\n }\r\n\r\n return clonedPath;\r\n };\r\n\r\n PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {\r\n var shapePaths;\r\n var i;\r\n var len = this.shapes.length;\r\n var j;\r\n var jLen;\r\n var amount = this.amount.v;\r\n\r\n if (amount !== 0) {\r\n var shapeData;\r\n var localShapeCollection;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapeData = this.shapes[i];\r\n localShapeCollection = shapeData.localShapeCollection;\r\n\r\n if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {\r\n localShapeCollection.releaseShapes();\r\n shapeData.shape._mdf = true;\r\n shapePaths = shapeData.shape.paths.shapes;\r\n jLen = shapeData.shape.paths._length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n localShapeCollection.addShape(this.processPath(shapePaths[j], amount));\r\n }\r\n }\r\n\r\n shapeData.shape.paths = shapeData.localShapeCollection;\r\n }\r\n }\r\n\r\n if (!this.dynamicProperties.length) {\r\n this._mdf = false;\r\n }\r\n };\r\n\r\n var TransformPropertyFactory = function () {\r\n var defaultVector = [0, 0];\r\n\r\n function applyToMatrix(mat) {\r\n var _mdf = this._mdf;\r\n this.iterateDynamicProperties();\r\n this._mdf = this._mdf || _mdf;\r\n\r\n if (this.a) {\r\n mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);\r\n }\r\n\r\n if (this.s) {\r\n mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);\r\n }\r\n\r\n if (this.sk) {\r\n mat.skewFromAxis(-this.sk.v, this.sa.v);\r\n }\r\n\r\n if (this.r) {\r\n mat.rotate(-this.r.v);\r\n } else {\r\n mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);\r\n }\r\n\r\n if (this.data.p.s) {\r\n if (this.data.p.z) {\r\n mat.translate(this.px.v, this.py.v, -this.pz.v);\r\n } else {\r\n mat.translate(this.px.v, this.py.v, 0);\r\n }\r\n } else {\r\n mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);\r\n }\r\n }\r\n\r\n function processKeys(forceRender) {\r\n if (this.elem.globalData.frameId === this.frameId) {\r\n return;\r\n }\r\n\r\n if (this._isDirty) {\r\n this.precalculateMatrix();\r\n this._isDirty = false;\r\n }\r\n\r\n this.iterateDynamicProperties();\r\n\r\n if (this._mdf || forceRender) {\r\n var frameRate;\r\n this.v.cloneFromProps(this.pre.props);\r\n\r\n if (this.appliedTransformations < 1) {\r\n this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);\r\n }\r\n\r\n if (this.appliedTransformations < 2) {\r\n this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);\r\n }\r\n\r\n if (this.sk && this.appliedTransformations < 3) {\r\n this.v.skewFromAxis(-this.sk.v, this.sa.v);\r\n }\r\n\r\n if (this.r && this.appliedTransformations < 4) {\r\n this.v.rotate(-this.r.v);\r\n } else if (!this.r && this.appliedTransformations < 4) {\r\n this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);\r\n }\r\n\r\n if (this.autoOriented) {\r\n var v1;\r\n var v2;\r\n frameRate = this.elem.globalData.frameRate;\r\n\r\n if (this.p && this.p.keyframes && this.p.getValueAtTime) {\r\n if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {\r\n v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);\r\n v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);\r\n } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {\r\n v1 = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / frameRate, 0);\r\n v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);\r\n } else {\r\n v1 = this.p.pv;\r\n v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);\r\n }\r\n } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {\r\n v1 = [];\r\n v2 = [];\r\n var px = this.px;\r\n var py = this.py;\r\n\r\n if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {\r\n v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);\r\n v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);\r\n v2[0] = px.getValueAtTime(px.keyframes[0].t / frameRate, 0);\r\n v2[1] = py.getValueAtTime(py.keyframes[0].t / frameRate, 0);\r\n } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {\r\n v1[0] = px.getValueAtTime(px.keyframes[px.keyframes.length - 1].t / frameRate, 0);\r\n v1[1] = py.getValueAtTime(py.keyframes[py.keyframes.length - 1].t / frameRate, 0);\r\n v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);\r\n v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);\r\n } else {\r\n v1 = [px.pv, py.pv];\r\n v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);\r\n v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);\r\n }\r\n } else {\r\n v2 = defaultVector;\r\n v1 = v2;\r\n }\r\n\r\n this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));\r\n }\r\n\r\n if (this.data.p && this.data.p.s) {\r\n if (this.data.p.z) {\r\n this.v.translate(this.px.v, this.py.v, -this.pz.v);\r\n } else {\r\n this.v.translate(this.px.v, this.py.v, 0);\r\n }\r\n } else {\r\n this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);\r\n }\r\n }\r\n\r\n this.frameId = this.elem.globalData.frameId;\r\n }\r\n\r\n function precalculateMatrix() {\r\n if (!this.a.k) {\r\n this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);\r\n this.appliedTransformations = 1;\r\n } else {\r\n return;\r\n }\r\n\r\n if (!this.s.effectsSequence.length) {\r\n this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);\r\n this.appliedTransformations = 2;\r\n } else {\r\n return;\r\n }\r\n\r\n if (this.sk) {\r\n if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {\r\n this.pre.skewFromAxis(-this.sk.v, this.sa.v);\r\n this.appliedTransformations = 3;\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n if (this.r) {\r\n if (!this.r.effectsSequence.length) {\r\n this.pre.rotate(-this.r.v);\r\n this.appliedTransformations = 4;\r\n }\r\n } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {\r\n this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);\r\n this.appliedTransformations = 4;\r\n }\r\n }\r\n\r\n function autoOrient() {//\r\n // var prevP = this.getValueAtTime();\r\n }\r\n\r\n function addDynamicProperty(prop) {\r\n this._addDynamicProperty(prop);\r\n\r\n this.elem.addDynamicProperty(prop);\r\n this._isDirty = true;\r\n }\r\n\r\n function TransformProperty(elem, data, container) {\r\n this.elem = elem;\r\n this.frameId = -1;\r\n this.propType = 'transform';\r\n this.data = data;\r\n this.v = new Matrix(); // Precalculated matrix with non animated properties\r\n\r\n this.pre = new Matrix();\r\n this.appliedTransformations = 0;\r\n this.initDynamicPropertyContainer(container || elem);\r\n\r\n if (data.p && data.p.s) {\r\n this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);\r\n this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);\r\n\r\n if (data.p.z) {\r\n this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);\r\n }\r\n } else {\r\n this.p = PropertyFactory.getProp(elem, data.p || {\r\n k: [0, 0, 0]\r\n }, 1, 0, this);\r\n }\r\n\r\n if (data.rx) {\r\n this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);\r\n this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);\r\n this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);\r\n\r\n if (data.or.k[0].ti) {\r\n var i;\r\n var len = data.or.k.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n data.or.k[i].to = null;\r\n data.or.k[i].ti = null;\r\n }\r\n }\r\n\r\n this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this); // sh Indicates it needs to be capped between -180 and 180\r\n\r\n this.or.sh = true;\r\n } else {\r\n this.r = PropertyFactory.getProp(elem, data.r || {\r\n k: 0\r\n }, 0, degToRads, this);\r\n }\r\n\r\n if (data.sk) {\r\n this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);\r\n this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);\r\n }\r\n\r\n this.a = PropertyFactory.getProp(elem, data.a || {\r\n k: [0, 0, 0]\r\n }, 1, 0, this);\r\n this.s = PropertyFactory.getProp(elem, data.s || {\r\n k: [100, 100, 100]\r\n }, 1, 0.01, this); // Opacity is not part of the transform properties, that's why it won't use this.dynamicProperties. That way transforms won't get updated if opacity changes.\r\n\r\n if (data.o) {\r\n this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);\r\n } else {\r\n this.o = {\r\n _mdf: false,\r\n v: 1\r\n };\r\n }\r\n\r\n this._isDirty = true;\r\n\r\n if (!this.dynamicProperties.length) {\r\n this.getValue(true);\r\n }\r\n }\r\n\r\n TransformProperty.prototype = {\r\n applyToMatrix: applyToMatrix,\r\n getValue: processKeys,\r\n precalculateMatrix: precalculateMatrix,\r\n autoOrient: autoOrient\r\n };\r\n extendPrototype([DynamicPropertyContainer], TransformProperty);\r\n TransformProperty.prototype.addDynamicProperty = addDynamicProperty;\r\n TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;\r\n\r\n function getTransformProperty(elem, data, container) {\r\n return new TransformProperty(elem, data, container);\r\n }\r\n\r\n return {\r\n getTransformProperty: getTransformProperty\r\n };\r\n }();\r\n\r\n function RepeaterModifier() {}\r\n\r\n extendPrototype([ShapeModifier], RepeaterModifier);\r\n\r\n RepeaterModifier.prototype.initModifierProperties = function (elem, data) {\r\n this.getValue = this.processKeys;\r\n this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);\r\n this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);\r\n this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);\r\n this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);\r\n this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);\r\n this.data = data;\r\n\r\n if (!this.dynamicProperties.length) {\r\n this.getValue(true);\r\n }\r\n\r\n this._isAnimated = !!this.dynamicProperties.length;\r\n this.pMatrix = new Matrix();\r\n this.rMatrix = new Matrix();\r\n this.sMatrix = new Matrix();\r\n this.tMatrix = new Matrix();\r\n this.matrix = new Matrix();\r\n };\r\n\r\n RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {\r\n var dir = inv ? -1 : 1;\r\n var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);\r\n var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);\r\n pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);\r\n rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);\r\n rMatrix.rotate(-transform.r.v * dir * perc);\r\n rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);\r\n sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);\r\n sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);\r\n sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);\r\n };\r\n\r\n RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {\r\n this.elem = elem;\r\n this.arr = arr;\r\n this.pos = pos;\r\n this.elemsData = elemsData;\r\n this._currentCopies = 0;\r\n this._elements = [];\r\n this._groups = [];\r\n this.frameId = -1;\r\n this.initDynamicPropertyContainer(elem);\r\n this.initModifierProperties(elem, arr[pos]);\r\n\r\n while (pos > 0) {\r\n pos -= 1; // this._elements.unshift(arr.splice(pos,1)[0]);\r\n\r\n this._elements.unshift(arr[pos]);\r\n }\r\n\r\n if (this.dynamicProperties.length) {\r\n this.k = true;\r\n } else {\r\n this.getValue(true);\r\n }\r\n };\r\n\r\n RepeaterModifier.prototype.resetElements = function (elements) {\r\n var i;\r\n var len = elements.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n elements[i]._processed = false;\r\n\r\n if (elements[i].ty === 'gr') {\r\n this.resetElements(elements[i].it);\r\n }\r\n }\r\n };\r\n\r\n RepeaterModifier.prototype.cloneElements = function (elements) {\r\n var newElements = JSON.parse(JSON.stringify(elements));\r\n this.resetElements(newElements);\r\n return newElements;\r\n };\r\n\r\n RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {\r\n var i;\r\n var len = elements.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n elements[i]._render = renderFlag;\r\n\r\n if (elements[i].ty === 'gr') {\r\n this.changeGroupRender(elements[i].it, renderFlag);\r\n }\r\n }\r\n };\r\n\r\n RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {\r\n var items;\r\n var itemsTransform;\r\n var i;\r\n var dir;\r\n var cont;\r\n var hasReloaded = false;\r\n\r\n if (this._mdf || _isFirstFrame) {\r\n var copies = Math.ceil(this.c.v);\r\n\r\n if (this._groups.length < copies) {\r\n while (this._groups.length < copies) {\r\n var group = {\r\n it: this.cloneElements(this._elements),\r\n ty: 'gr'\r\n };\r\n group.it.push({\r\n a: {\r\n a: 0,\r\n ix: 1,\r\n k: [0, 0]\r\n },\r\n nm: 'Transform',\r\n o: {\r\n a: 0,\r\n ix: 7,\r\n k: 100\r\n },\r\n p: {\r\n a: 0,\r\n ix: 2,\r\n k: [0, 0]\r\n },\r\n r: {\r\n a: 1,\r\n ix: 6,\r\n k: [{\r\n s: 0,\r\n e: 0,\r\n t: 0\r\n }, {\r\n s: 0,\r\n e: 0,\r\n t: 1\r\n }]\r\n },\r\n s: {\r\n a: 0,\r\n ix: 3,\r\n k: [100, 100]\r\n },\r\n sa: {\r\n a: 0,\r\n ix: 5,\r\n k: 0\r\n },\r\n sk: {\r\n a: 0,\r\n ix: 4,\r\n k: 0\r\n },\r\n ty: 'tr'\r\n });\r\n this.arr.splice(0, 0, group);\r\n\r\n this._groups.splice(0, 0, group);\r\n\r\n this._currentCopies += 1;\r\n }\r\n\r\n this.elem.reloadShapes();\r\n hasReloaded = true;\r\n }\r\n\r\n cont = 0;\r\n var renderFlag;\r\n\r\n for (i = 0; i <= this._groups.length - 1; i += 1) {\r\n renderFlag = cont < copies;\r\n this._groups[i]._render = renderFlag;\r\n this.changeGroupRender(this._groups[i].it, renderFlag);\r\n\r\n if (!renderFlag) {\r\n var elems = this.elemsData[i].it;\r\n var transformData = elems[elems.length - 1];\r\n\r\n if (transformData.transform.op.v !== 0) {\r\n transformData.transform.op._mdf = true;\r\n transformData.transform.op.v = 0;\r\n } else {\r\n transformData.transform.op._mdf = false;\r\n }\r\n }\r\n\r\n cont += 1;\r\n }\r\n\r\n this._currentCopies = copies; /// /\r\n\r\n var offset = this.o.v;\r\n var offsetModulo = offset % 1;\r\n var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);\r\n var pProps = this.pMatrix.props;\r\n var rProps = this.rMatrix.props;\r\n var sProps = this.sMatrix.props;\r\n this.pMatrix.reset();\r\n this.rMatrix.reset();\r\n this.sMatrix.reset();\r\n this.tMatrix.reset();\r\n this.matrix.reset();\r\n var iteration = 0;\r\n\r\n if (offset > 0) {\r\n while (iteration < roundOffset) {\r\n this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);\r\n iteration += 1;\r\n }\r\n\r\n if (offsetModulo) {\r\n this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);\r\n iteration += offsetModulo;\r\n }\r\n } else if (offset < 0) {\r\n while (iteration > roundOffset) {\r\n this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);\r\n iteration -= 1;\r\n }\r\n\r\n if (offsetModulo) {\r\n this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);\r\n iteration -= offsetModulo;\r\n }\r\n }\r\n\r\n i = this.data.m === 1 ? 0 : this._currentCopies - 1;\r\n dir = this.data.m === 1 ? 1 : -1;\r\n cont = this._currentCopies;\r\n var j;\r\n var jLen;\r\n\r\n while (cont) {\r\n items = this.elemsData[i].it;\r\n itemsTransform = items[items.length - 1].transform.mProps.v.props;\r\n jLen = itemsTransform.length;\r\n items[items.length - 1].transform.mProps._mdf = true;\r\n items[items.length - 1].transform.op._mdf = true;\r\n items[items.length - 1].transform.op.v = this._currentCopies === 1 ? this.so.v : this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));\r\n\r\n if (iteration !== 0) {\r\n if (i !== 0 && dir === 1 || i !== this._currentCopies - 1 && dir === -1) {\r\n this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);\r\n }\r\n\r\n this.matrix.transform(rProps[0], rProps[1], rProps[2], rProps[3], rProps[4], rProps[5], rProps[6], rProps[7], rProps[8], rProps[9], rProps[10], rProps[11], rProps[12], rProps[13], rProps[14], rProps[15]);\r\n this.matrix.transform(sProps[0], sProps[1], sProps[2], sProps[3], sProps[4], sProps[5], sProps[6], sProps[7], sProps[8], sProps[9], sProps[10], sProps[11], sProps[12], sProps[13], sProps[14], sProps[15]);\r\n this.matrix.transform(pProps[0], pProps[1], pProps[2], pProps[3], pProps[4], pProps[5], pProps[6], pProps[7], pProps[8], pProps[9], pProps[10], pProps[11], pProps[12], pProps[13], pProps[14], pProps[15]);\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n itemsTransform[j] = this.matrix.props[j];\r\n }\r\n\r\n this.matrix.reset();\r\n } else {\r\n this.matrix.reset();\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n itemsTransform[j] = this.matrix.props[j];\r\n }\r\n }\r\n\r\n iteration += 1;\r\n cont -= 1;\r\n i += dir;\r\n }\r\n } else {\r\n cont = this._currentCopies;\r\n i = 0;\r\n dir = 1;\r\n\r\n while (cont) {\r\n items = this.elemsData[i].it;\r\n itemsTransform = items[items.length - 1].transform.mProps.v.props;\r\n items[items.length - 1].transform.mProps._mdf = false;\r\n items[items.length - 1].transform.op._mdf = false;\r\n cont -= 1;\r\n i += dir;\r\n }\r\n }\r\n\r\n return hasReloaded;\r\n };\r\n\r\n RepeaterModifier.prototype.addShape = function () {};\r\n\r\n function RoundCornersModifier() {}\r\n\r\n extendPrototype([ShapeModifier], RoundCornersModifier);\r\n\r\n RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {\r\n this.getValue = this.processKeys;\r\n this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);\r\n this._isAnimated = !!this.rd.effectsSequence.length;\r\n };\r\n\r\n RoundCornersModifier.prototype.processPath = function (path, round) {\r\n var clonedPath = shapePool.newElement();\r\n clonedPath.c = path.c;\r\n var i;\r\n var len = path._length;\r\n var currentV;\r\n var currentI;\r\n var currentO;\r\n var closerV;\r\n var distance;\r\n var newPosPerc;\r\n var index = 0;\r\n var vX;\r\n var vY;\r\n var oX;\r\n var oY;\r\n var iX;\r\n var iY;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n currentV = path.v[i];\r\n currentO = path.o[i];\r\n currentI = path.i[i];\r\n\r\n if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {\r\n if ((i === 0 || i === len - 1) && !path.c) {\r\n clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);\r\n /* clonedPath.v[index] = currentV;\r\n clonedPath.o[index] = currentO;\r\n clonedPath.i[index] = currentI; */\r\n\r\n index += 1;\r\n } else {\r\n if (i === 0) {\r\n closerV = path.v[len - 1];\r\n } else {\r\n closerV = path.v[i - 1];\r\n }\r\n\r\n distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));\r\n newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;\r\n iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;\r\n vX = iX;\r\n iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;\r\n vY = iY;\r\n oX = vX - (vX - currentV[0]) * roundCorner;\r\n oY = vY - (vY - currentV[1]) * roundCorner;\r\n clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);\r\n index += 1;\r\n\r\n if (i === len - 1) {\r\n closerV = path.v[0];\r\n } else {\r\n closerV = path.v[i + 1];\r\n }\r\n\r\n distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));\r\n newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;\r\n oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;\r\n vX = oX;\r\n oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;\r\n vY = oY;\r\n iX = vX - (vX - currentV[0]) * roundCorner;\r\n iY = vY - (vY - currentV[1]) * roundCorner;\r\n clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);\r\n index += 1;\r\n }\r\n } else {\r\n clonedPath.setTripleAt(path.v[i][0], path.v[i][1], path.o[i][0], path.o[i][1], path.i[i][0], path.i[i][1], index);\r\n index += 1;\r\n }\r\n }\r\n\r\n return clonedPath;\r\n };\r\n\r\n RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {\r\n var shapePaths;\r\n var i;\r\n var len = this.shapes.length;\r\n var j;\r\n var jLen;\r\n var rd = this.rd.v;\r\n\r\n if (rd !== 0) {\r\n var shapeData;\r\n var localShapeCollection;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapeData = this.shapes[i];\r\n localShapeCollection = shapeData.localShapeCollection;\r\n\r\n if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {\r\n localShapeCollection.releaseShapes();\r\n shapeData.shape._mdf = true;\r\n shapePaths = shapeData.shape.paths.shapes;\r\n jLen = shapeData.shape.paths._length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n localShapeCollection.addShape(this.processPath(shapePaths[j], rd));\r\n }\r\n }\r\n\r\n shapeData.shape.paths = shapeData.localShapeCollection;\r\n }\r\n }\r\n\r\n if (!this.dynamicProperties.length) {\r\n this._mdf = false;\r\n }\r\n };\r\n\r\n function floatEqual(a, b) {\r\n return Math.abs(a - b) * 100000 <= Math.min(Math.abs(a), Math.abs(b));\r\n }\r\n\r\n function floatZero(f) {\r\n return Math.abs(f) <= 0.00001;\r\n }\r\n\r\n function lerp(p0, p1, amount) {\r\n return p0 * (1 - amount) + p1 * amount;\r\n }\r\n\r\n function lerpPoint(p0, p1, amount) {\r\n return [lerp(p0[0], p1[0], amount), lerp(p0[1], p1[1], amount)];\r\n }\r\n\r\n function quadRoots(a, b, c) {\r\n // no root\r\n if (a === 0) return [];\r\n var s = b * b - 4 * a * c; // Complex roots\r\n\r\n if (s < 0) return [];\r\n var singleRoot = -b / (2 * a); // 1 root\r\n\r\n if (s === 0) return [singleRoot];\r\n var delta = Math.sqrt(s) / (2 * a); // 2 roots\r\n\r\n return [singleRoot - delta, singleRoot + delta];\r\n }\r\n\r\n function polynomialCoefficients(p0, p1, p2, p3) {\r\n return [-p0 + 3 * p1 - 3 * p2 + p3, 3 * p0 - 6 * p1 + 3 * p2, -3 * p0 + 3 * p1, p0];\r\n }\r\n\r\n function singlePoint(p) {\r\n return new PolynomialBezier(p, p, p, p, false);\r\n }\r\n\r\n function PolynomialBezier(p0, p1, p2, p3, linearize) {\r\n if (linearize && pointEqual(p0, p1)) {\r\n p1 = lerpPoint(p0, p3, 1 / 3);\r\n }\r\n\r\n if (linearize && pointEqual(p2, p3)) {\r\n p2 = lerpPoint(p0, p3, 2 / 3);\r\n }\r\n\r\n var coeffx = polynomialCoefficients(p0[0], p1[0], p2[0], p3[0]);\r\n var coeffy = polynomialCoefficients(p0[1], p1[1], p2[1], p3[1]);\r\n this.a = [coeffx[0], coeffy[0]];\r\n this.b = [coeffx[1], coeffy[1]];\r\n this.c = [coeffx[2], coeffy[2]];\r\n this.d = [coeffx[3], coeffy[3]];\r\n this.points = [p0, p1, p2, p3];\r\n }\r\n\r\n PolynomialBezier.prototype.point = function (t) {\r\n return [((this.a[0] * t + this.b[0]) * t + this.c[0]) * t + this.d[0], ((this.a[1] * t + this.b[1]) * t + this.c[1]) * t + this.d[1]];\r\n };\r\n\r\n PolynomialBezier.prototype.derivative = function (t) {\r\n return [(3 * t * this.a[0] + 2 * this.b[0]) * t + this.c[0], (3 * t * this.a[1] + 2 * this.b[1]) * t + this.c[1]];\r\n };\r\n\r\n PolynomialBezier.prototype.tangentAngle = function (t) {\r\n var p = this.derivative(t);\r\n return Math.atan2(p[1], p[0]);\r\n };\r\n\r\n PolynomialBezier.prototype.normalAngle = function (t) {\r\n var p = this.derivative(t);\r\n return Math.atan2(p[0], p[1]);\r\n };\r\n\r\n PolynomialBezier.prototype.inflectionPoints = function () {\r\n var denom = this.a[1] * this.b[0] - this.a[0] * this.b[1];\r\n if (floatZero(denom)) return [];\r\n var tcusp = -0.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1]) / denom;\r\n var square = tcusp * tcusp - 1 / 3 * (this.b[1] * this.c[0] - this.b[0] * this.c[1]) / denom;\r\n if (square < 0) return [];\r\n var root = Math.sqrt(square);\r\n\r\n if (floatZero(root)) {\r\n if (root > 0 && root < 1) return [tcusp];\r\n return [];\r\n }\r\n\r\n return [tcusp - root, tcusp + root].filter(function (r) {\r\n return r > 0 && r < 1;\r\n });\r\n };\r\n\r\n PolynomialBezier.prototype.split = function (t) {\r\n if (t <= 0) return [singlePoint(this.points[0]), this];\r\n if (t >= 1) return [this, singlePoint(this.points[this.points.length - 1])];\r\n var p10 = lerpPoint(this.points[0], this.points[1], t);\r\n var p11 = lerpPoint(this.points[1], this.points[2], t);\r\n var p12 = lerpPoint(this.points[2], this.points[3], t);\r\n var p20 = lerpPoint(p10, p11, t);\r\n var p21 = lerpPoint(p11, p12, t);\r\n var p3 = lerpPoint(p20, p21, t);\r\n return [new PolynomialBezier(this.points[0], p10, p20, p3, true), new PolynomialBezier(p3, p21, p12, this.points[3], true)];\r\n };\r\n\r\n function extrema(bez, comp) {\r\n var min = bez.points[0][comp];\r\n var max = bez.points[bez.points.length - 1][comp];\r\n\r\n if (min > max) {\r\n var e = max;\r\n max = min;\r\n min = e;\r\n } // Derivative roots to find min/max\r\n\r\n\r\n var f = quadRoots(3 * bez.a[comp], 2 * bez.b[comp], bez.c[comp]);\r\n\r\n for (var i = 0; i < f.length; i += 1) {\r\n if (f[i] > 0 && f[i] < 1) {\r\n var val = bez.point(f[i])[comp];\r\n if (val < min) min = val;else if (val > max) max = val;\r\n }\r\n }\r\n\r\n return {\r\n min: min,\r\n max: max\r\n };\r\n }\r\n\r\n PolynomialBezier.prototype.bounds = function () {\r\n return {\r\n x: extrema(this, 0),\r\n y: extrema(this, 1)\r\n };\r\n };\r\n\r\n PolynomialBezier.prototype.boundingBox = function () {\r\n var bounds = this.bounds();\r\n return {\r\n left: bounds.x.min,\r\n right: bounds.x.max,\r\n top: bounds.y.min,\r\n bottom: bounds.y.max,\r\n width: bounds.x.max - bounds.x.min,\r\n height: bounds.y.max - bounds.y.min,\r\n cx: (bounds.x.max + bounds.x.min) / 2,\r\n cy: (bounds.y.max + bounds.y.min) / 2\r\n };\r\n };\r\n\r\n function intersectData(bez, t1, t2) {\r\n var box = bez.boundingBox();\r\n return {\r\n cx: box.cx,\r\n cy: box.cy,\r\n width: box.width,\r\n height: box.height,\r\n bez: bez,\r\n t: (t1 + t2) / 2,\r\n t1: t1,\r\n t2: t2\r\n };\r\n }\r\n\r\n function splitData(data) {\r\n var split = data.bez.split(0.5);\r\n return [intersectData(split[0], data.t1, data.t), intersectData(split[1], data.t, data.t2)];\r\n }\r\n\r\n function boxIntersect(b1, b2) {\r\n return Math.abs(b1.cx - b2.cx) * 2 < b1.width + b2.width && Math.abs(b1.cy - b2.cy) * 2 < b1.height + b2.height;\r\n }\r\n\r\n function intersectsImpl(d1, d2, depth, tolerance, intersections, maxRecursion) {\r\n if (!boxIntersect(d1, d2)) return;\r\n\r\n if (depth >= maxRecursion || d1.width <= tolerance && d1.height <= tolerance && d2.width <= tolerance && d2.height <= tolerance) {\r\n intersections.push([d1.t, d2.t]);\r\n return;\r\n }\r\n\r\n var d1s = splitData(d1);\r\n var d2s = splitData(d2);\r\n intersectsImpl(d1s[0], d2s[0], depth + 1, tolerance, intersections, maxRecursion);\r\n intersectsImpl(d1s[0], d2s[1], depth + 1, tolerance, intersections, maxRecursion);\r\n intersectsImpl(d1s[1], d2s[0], depth + 1, tolerance, intersections, maxRecursion);\r\n intersectsImpl(d1s[1], d2s[1], depth + 1, tolerance, intersections, maxRecursion);\r\n }\r\n\r\n PolynomialBezier.prototype.intersections = function (other, tolerance, maxRecursion) {\r\n if (tolerance === undefined) tolerance = 2;\r\n if (maxRecursion === undefined) maxRecursion = 7;\r\n var intersections = [];\r\n intersectsImpl(intersectData(this, 0, 1), intersectData(other, 0, 1), 0, tolerance, intersections, maxRecursion);\r\n return intersections;\r\n };\r\n\r\n PolynomialBezier.shapeSegment = function (shapePath, index) {\r\n var nextIndex = (index + 1) % shapePath.length();\r\n return new PolynomialBezier(shapePath.v[index], shapePath.o[index], shapePath.i[nextIndex], shapePath.v[nextIndex], true);\r\n };\r\n\r\n PolynomialBezier.shapeSegmentInverted = function (shapePath, index) {\r\n var nextIndex = (index + 1) % shapePath.length();\r\n return new PolynomialBezier(shapePath.v[nextIndex], shapePath.i[nextIndex], shapePath.o[index], shapePath.v[index], true);\r\n };\r\n\r\n function crossProduct(a, b) {\r\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\r\n }\r\n\r\n function lineIntersection(start1, end1, start2, end2) {\r\n var v1 = [start1[0], start1[1], 1];\r\n var v2 = [end1[0], end1[1], 1];\r\n var v3 = [start2[0], start2[1], 1];\r\n var v4 = [end2[0], end2[1], 1];\r\n var r = crossProduct(crossProduct(v1, v2), crossProduct(v3, v4));\r\n if (floatZero(r[2])) return null;\r\n return [r[0] / r[2], r[1] / r[2]];\r\n }\r\n\r\n function polarOffset(p, angle, length) {\r\n return [p[0] + Math.cos(angle) * length, p[1] - Math.sin(angle) * length];\r\n }\r\n\r\n function pointDistance(p1, p2) {\r\n return Math.hypot(p1[0] - p2[0], p1[1] - p2[1]);\r\n }\r\n\r\n function pointEqual(p1, p2) {\r\n return floatEqual(p1[0], p2[0]) && floatEqual(p1[1], p2[1]);\r\n }\r\n\r\n function ZigZagModifier() {}\r\n\r\n extendPrototype([ShapeModifier], ZigZagModifier);\r\n\r\n ZigZagModifier.prototype.initModifierProperties = function (elem, data) {\r\n this.getValue = this.processKeys;\r\n this.amplitude = PropertyFactory.getProp(elem, data.s, 0, null, this);\r\n this.frequency = PropertyFactory.getProp(elem, data.r, 0, null, this);\r\n this.pointsType = PropertyFactory.getProp(elem, data.pt, 0, null, this);\r\n this._isAnimated = this.amplitude.effectsSequence.length !== 0 || this.frequency.effectsSequence.length !== 0 || this.pointsType.effectsSequence.length !== 0;\r\n };\r\n\r\n function setPoint(outputBezier, point, angle, direction, amplitude, outAmplitude, inAmplitude) {\r\n var angO = angle - Math.PI / 2;\r\n var angI = angle + Math.PI / 2;\r\n var px = point[0] + Math.cos(angle) * direction * amplitude;\r\n var py = point[1] - Math.sin(angle) * direction * amplitude;\r\n outputBezier.setTripleAt(px, py, px + Math.cos(angO) * outAmplitude, py - Math.sin(angO) * outAmplitude, px + Math.cos(angI) * inAmplitude, py - Math.sin(angI) * inAmplitude, outputBezier.length());\r\n }\r\n\r\n function getPerpendicularVector(pt1, pt2) {\r\n var vector = [pt2[0] - pt1[0], pt2[1] - pt1[1]];\r\n var rot = -Math.PI * 0.5;\r\n var rotatedVector = [Math.cos(rot) * vector[0] - Math.sin(rot) * vector[1], Math.sin(rot) * vector[0] + Math.cos(rot) * vector[1]];\r\n return rotatedVector;\r\n }\r\n\r\n function getProjectingAngle(path, cur) {\r\n var prevIndex = cur === 0 ? path.length() - 1 : cur - 1;\r\n var nextIndex = (cur + 1) % path.length();\r\n var prevPoint = path.v[prevIndex];\r\n var nextPoint = path.v[nextIndex];\r\n var pVector = getPerpendicularVector(prevPoint, nextPoint);\r\n return Math.atan2(0, 1) - Math.atan2(pVector[1], pVector[0]);\r\n }\r\n\r\n function zigZagCorner(outputBezier, path, cur, amplitude, frequency, pointType, direction) {\r\n var angle = getProjectingAngle(path, cur);\r\n var point = path.v[cur % path._length];\r\n var prevPoint = path.v[cur === 0 ? path._length - 1 : cur - 1];\r\n var nextPoint = path.v[(cur + 1) % path._length];\r\n var prevDist = pointType === 2 ? Math.sqrt(Math.pow(point[0] - prevPoint[0], 2) + Math.pow(point[1] - prevPoint[1], 2)) : 0;\r\n var nextDist = pointType === 2 ? Math.sqrt(Math.pow(point[0] - nextPoint[0], 2) + Math.pow(point[1] - nextPoint[1], 2)) : 0;\r\n setPoint(outputBezier, path.v[cur % path._length], angle, direction, amplitude, nextDist / ((frequency + 1) * 2), prevDist / ((frequency + 1) * 2), pointType);\r\n }\r\n\r\n function zigZagSegment(outputBezier, segment, amplitude, frequency, pointType, direction) {\r\n for (var i = 0; i < frequency; i += 1) {\r\n var t = (i + 1) / (frequency + 1);\r\n var dist = pointType === 2 ? Math.sqrt(Math.pow(segment.points[3][0] - segment.points[0][0], 2) + Math.pow(segment.points[3][1] - segment.points[0][1], 2)) : 0;\r\n var angle = segment.normalAngle(t);\r\n var point = segment.point(t);\r\n setPoint(outputBezier, point, angle, direction, amplitude, dist / ((frequency + 1) * 2), dist / ((frequency + 1) * 2), pointType);\r\n direction = -direction;\r\n }\r\n\r\n return direction;\r\n }\r\n\r\n ZigZagModifier.prototype.processPath = function (path, amplitude, frequency, pointType) {\r\n var count = path._length;\r\n var clonedPath = shapePool.newElement();\r\n clonedPath.c = path.c;\r\n\r\n if (!path.c) {\r\n count -= 1;\r\n }\r\n\r\n if (count === 0) return clonedPath;\r\n var direction = -1;\r\n var segment = PolynomialBezier.shapeSegment(path, 0);\r\n zigZagCorner(clonedPath, path, 0, amplitude, frequency, pointType, direction);\r\n\r\n for (var i = 0; i < count; i += 1) {\r\n direction = zigZagSegment(clonedPath, segment, amplitude, frequency, pointType, -direction);\r\n\r\n if (i === count - 1 && !path.c) {\r\n segment = null;\r\n } else {\r\n segment = PolynomialBezier.shapeSegment(path, (i + 1) % count);\r\n }\r\n\r\n zigZagCorner(clonedPath, path, i + 1, amplitude, frequency, pointType, direction);\r\n }\r\n\r\n return clonedPath;\r\n };\r\n\r\n ZigZagModifier.prototype.processShapes = function (_isFirstFrame) {\r\n var shapePaths;\r\n var i;\r\n var len = this.shapes.length;\r\n var j;\r\n var jLen;\r\n var amplitude = this.amplitude.v;\r\n var frequency = Math.max(0, Math.round(this.frequency.v));\r\n var pointType = this.pointsType.v;\r\n\r\n if (amplitude !== 0) {\r\n var shapeData;\r\n var localShapeCollection;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapeData = this.shapes[i];\r\n localShapeCollection = shapeData.localShapeCollection;\r\n\r\n if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {\r\n localShapeCollection.releaseShapes();\r\n shapeData.shape._mdf = true;\r\n shapePaths = shapeData.shape.paths.shapes;\r\n jLen = shapeData.shape.paths._length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n localShapeCollection.addShape(this.processPath(shapePaths[j], amplitude, frequency, pointType));\r\n }\r\n }\r\n\r\n shapeData.shape.paths = shapeData.localShapeCollection;\r\n }\r\n }\r\n\r\n if (!this.dynamicProperties.length) {\r\n this._mdf = false;\r\n }\r\n };\r\n\r\n function linearOffset(p1, p2, amount) {\r\n var angle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]);\r\n return [polarOffset(p1, angle, amount), polarOffset(p2, angle, amount)];\r\n }\r\n\r\n function offsetSegment(segment, amount) {\r\n var p0;\r\n var p1a;\r\n var p1b;\r\n var p2b;\r\n var p2a;\r\n var p3;\r\n var e;\r\n e = linearOffset(segment.points[0], segment.points[1], amount);\r\n p0 = e[0];\r\n p1a = e[1];\r\n e = linearOffset(segment.points[1], segment.points[2], amount);\r\n p1b = e[0];\r\n p2b = e[1];\r\n e = linearOffset(segment.points[2], segment.points[3], amount);\r\n p2a = e[0];\r\n p3 = e[1];\r\n var p1 = lineIntersection(p0, p1a, p1b, p2b);\r\n if (p1 === null) p1 = p1a;\r\n var p2 = lineIntersection(p2a, p3, p1b, p2b);\r\n if (p2 === null) p2 = p2a;\r\n return new PolynomialBezier(p0, p1, p2, p3);\r\n }\r\n\r\n function joinLines(outputBezier, seg1, seg2, lineJoin, miterLimit) {\r\n var p0 = seg1.points[3];\r\n var p1 = seg2.points[0]; // Bevel\r\n\r\n if (lineJoin === 3) return p0; // Connected, they don't need a joint\r\n\r\n if (pointEqual(p0, p1)) return p0; // Round\r\n\r\n if (lineJoin === 2) {\r\n var angleOut = -seg1.tangentAngle(1);\r\n var angleIn = -seg2.tangentAngle(0) + Math.PI;\r\n var center = lineIntersection(p0, polarOffset(p0, angleOut + Math.PI / 2, 100), p1, polarOffset(p1, angleOut + Math.PI / 2, 100));\r\n var radius = center ? pointDistance(center, p0) : pointDistance(p0, p1) / 2;\r\n var tan = polarOffset(p0, angleOut, 2 * radius * roundCorner);\r\n outputBezier.setXYAt(tan[0], tan[1], 'o', outputBezier.length() - 1);\r\n tan = polarOffset(p1, angleIn, 2 * radius * roundCorner);\r\n outputBezier.setTripleAt(p1[0], p1[1], p1[0], p1[1], tan[0], tan[1], outputBezier.length());\r\n return p1;\r\n } // Miter\r\n\r\n\r\n var t0 = pointEqual(p0, seg1.points[2]) ? seg1.points[0] : seg1.points[2];\r\n var t1 = pointEqual(p1, seg2.points[1]) ? seg2.points[3] : seg2.points[1];\r\n var intersection = lineIntersection(t0, p0, p1, t1);\r\n\r\n if (intersection && pointDistance(intersection, p0) < miterLimit) {\r\n outputBezier.setTripleAt(intersection[0], intersection[1], intersection[0], intersection[1], intersection[0], intersection[1], outputBezier.length());\r\n return intersection;\r\n }\r\n\r\n return p0;\r\n }\r\n\r\n function getIntersection(a, b) {\r\n var intersect = a.intersections(b);\r\n if (intersect.length && floatEqual(intersect[0][0], 1)) intersect.shift();\r\n if (intersect.length) return intersect[0];\r\n return null;\r\n }\r\n\r\n function pruneSegmentIntersection(a, b) {\r\n var outa = a.slice();\r\n var outb = b.slice();\r\n var intersect = getIntersection(a[a.length - 1], b[0]);\r\n\r\n if (intersect) {\r\n outa[a.length - 1] = a[a.length - 1].split(intersect[0])[0];\r\n outb[0] = b[0].split(intersect[1])[1];\r\n }\r\n\r\n if (a.length > 1 && b.length > 1) {\r\n intersect = getIntersection(a[0], b[b.length - 1]);\r\n\r\n if (intersect) {\r\n return [[a[0].split(intersect[0])[0]], [b[b.length - 1].split(intersect[1])[1]]];\r\n }\r\n }\r\n\r\n return [outa, outb];\r\n }\r\n\r\n function pruneIntersections(segments) {\r\n var e;\r\n\r\n for (var i = 1; i < segments.length; i += 1) {\r\n e = pruneSegmentIntersection(segments[i - 1], segments[i]);\r\n segments[i - 1] = e[0];\r\n segments[i] = e[1];\r\n }\r\n\r\n if (segments.length > 1) {\r\n e = pruneSegmentIntersection(segments[segments.length - 1], segments[0]);\r\n segments[segments.length - 1] = e[0];\r\n segments[0] = e[1];\r\n }\r\n\r\n return segments;\r\n }\r\n\r\n function offsetSegmentSplit(segment, amount) {\r\n /*\r\n We split each bezier segment into smaller pieces based\r\n on inflection points, this ensures the control point\r\n polygon is convex.\r\n (A cubic bezier can have none, one, or two inflection points)\r\n */\r\n var flex = segment.inflectionPoints();\r\n var left;\r\n var right;\r\n var split;\r\n var mid;\r\n\r\n if (flex.length === 0) {\r\n return [offsetSegment(segment, amount)];\r\n }\r\n\r\n if (flex.length === 1 || floatEqual(flex[1], 1)) {\r\n split = segment.split(flex[0]);\r\n left = split[0];\r\n right = split[1];\r\n return [offsetSegment(left, amount), offsetSegment(right, amount)];\r\n }\r\n\r\n split = segment.split(flex[0]);\r\n left = split[0];\r\n var t = (flex[1] - flex[0]) / (1 - flex[0]);\r\n split = split[1].split(t);\r\n mid = split[0];\r\n right = split[1];\r\n return [offsetSegment(left, amount), offsetSegment(mid, amount), offsetSegment(right, amount)];\r\n }\r\n\r\n function OffsetPathModifier() {}\r\n\r\n extendPrototype([ShapeModifier], OffsetPathModifier);\r\n\r\n OffsetPathModifier.prototype.initModifierProperties = function (elem, data) {\r\n this.getValue = this.processKeys;\r\n this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);\r\n this.miterLimit = PropertyFactory.getProp(elem, data.ml, 0, null, this);\r\n this.lineJoin = data.lj;\r\n this._isAnimated = this.amount.effectsSequence.length !== 0;\r\n };\r\n\r\n OffsetPathModifier.prototype.processPath = function (inputBezier, amount, lineJoin, miterLimit) {\r\n var outputBezier = shapePool.newElement();\r\n outputBezier.c = inputBezier.c;\r\n var count = inputBezier.length();\r\n\r\n if (!inputBezier.c) {\r\n count -= 1;\r\n }\r\n\r\n var i;\r\n var j;\r\n var segment;\r\n var multiSegments = [];\r\n\r\n for (i = 0; i < count; i += 1) {\r\n segment = PolynomialBezier.shapeSegment(inputBezier, i);\r\n multiSegments.push(offsetSegmentSplit(segment, amount));\r\n }\r\n\r\n if (!inputBezier.c) {\r\n for (i = count - 1; i >= 0; i -= 1) {\r\n segment = PolynomialBezier.shapeSegmentInverted(inputBezier, i);\r\n multiSegments.push(offsetSegmentSplit(segment, amount));\r\n }\r\n }\r\n\r\n multiSegments = pruneIntersections(multiSegments); // Add bezier segments to the output and apply line joints\r\n\r\n var lastPoint = null;\r\n var lastSeg = null;\r\n\r\n for (i = 0; i < multiSegments.length; i += 1) {\r\n var multiSegment = multiSegments[i];\r\n if (lastSeg) lastPoint = joinLines(outputBezier, lastSeg, multiSegment[0], lineJoin, miterLimit);\r\n lastSeg = multiSegment[multiSegment.length - 1];\r\n\r\n for (j = 0; j < multiSegment.length; j += 1) {\r\n segment = multiSegment[j];\r\n\r\n if (lastPoint && pointEqual(segment.points[0], lastPoint)) {\r\n outputBezier.setXYAt(segment.points[1][0], segment.points[1][1], 'o', outputBezier.length() - 1);\r\n } else {\r\n outputBezier.setTripleAt(segment.points[0][0], segment.points[0][1], segment.points[1][0], segment.points[1][1], segment.points[0][0], segment.points[0][1], outputBezier.length());\r\n }\r\n\r\n outputBezier.setTripleAt(segment.points[3][0], segment.points[3][1], segment.points[3][0], segment.points[3][1], segment.points[2][0], segment.points[2][1], outputBezier.length());\r\n lastPoint = segment.points[3];\r\n }\r\n }\r\n\r\n if (multiSegments.length) joinLines(outputBezier, lastSeg, multiSegments[0][0], lineJoin, miterLimit);\r\n return outputBezier;\r\n };\r\n\r\n OffsetPathModifier.prototype.processShapes = function (_isFirstFrame) {\r\n var shapePaths;\r\n var i;\r\n var len = this.shapes.length;\r\n var j;\r\n var jLen;\r\n var amount = this.amount.v;\r\n var miterLimit = this.miterLimit.v;\r\n var lineJoin = this.lineJoin;\r\n\r\n if (amount !== 0) {\r\n var shapeData;\r\n var localShapeCollection;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapeData = this.shapes[i];\r\n localShapeCollection = shapeData.localShapeCollection;\r\n\r\n if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {\r\n localShapeCollection.releaseShapes();\r\n shapeData.shape._mdf = true;\r\n shapePaths = shapeData.shape.paths.shapes;\r\n jLen = shapeData.shape.paths._length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n localShapeCollection.addShape(this.processPath(shapePaths[j], amount, lineJoin, miterLimit));\r\n }\r\n }\r\n\r\n shapeData.shape.paths = shapeData.localShapeCollection;\r\n }\r\n }\r\n\r\n if (!this.dynamicProperties.length) {\r\n this._mdf = false;\r\n }\r\n };\r\n\r\n function getFontProperties(fontData) {\r\n var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];\r\n var fWeight = 'normal';\r\n var fStyle = 'normal';\r\n var len = styles.length;\r\n var styleName;\r\n\r\n for (var i = 0; i < len; i += 1) {\r\n styleName = styles[i].toLowerCase();\r\n\r\n switch (styleName) {\r\n case 'italic':\r\n fStyle = 'italic';\r\n break;\r\n\r\n case 'bold':\r\n fWeight = '700';\r\n break;\r\n\r\n case 'black':\r\n fWeight = '900';\r\n break;\r\n\r\n case 'medium':\r\n fWeight = '500';\r\n break;\r\n\r\n case 'regular':\r\n case 'normal':\r\n fWeight = '400';\r\n break;\r\n\r\n case 'light':\r\n case 'thin':\r\n fWeight = '200';\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n return {\r\n style: fStyle,\r\n weight: fontData.fWeight || fWeight\r\n };\r\n }\r\n\r\n var FontManager = function () {\r\n var maxWaitingTime = 5000;\r\n var emptyChar = {\r\n w: 0,\r\n size: 0,\r\n shapes: [],\r\n data: {\r\n shapes: []\r\n }\r\n };\r\n var combinedCharacters = []; // Hindi characters\r\n\r\n combinedCharacters = combinedCharacters.concat([2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403]);\r\n var surrogateModifiers = ['d83cdffb', 'd83cdffc', 'd83cdffd', 'd83cdffe', 'd83cdfff'];\r\n var zeroWidthJoiner = [65039, 8205];\r\n\r\n function trimFontOptions(font) {\r\n var familyArray = font.split(',');\r\n var i;\r\n var len = familyArray.length;\r\n var enabledFamilies = [];\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {\r\n enabledFamilies.push(familyArray[i]);\r\n }\r\n }\r\n\r\n return enabledFamilies.join(',');\r\n }\r\n\r\n function setUpNode(font, family) {\r\n var parentNode = createTag('span'); // Node is invisible to screen readers.\r\n\r\n parentNode.setAttribute('aria-hidden', true);\r\n parentNode.style.fontFamily = family;\r\n var node = createTag('span'); // Characters that vary significantly among different fonts\r\n\r\n node.innerText = 'giItT1WQy@!-/#'; // Visible - so we can measure it - but not on the screen\r\n\r\n parentNode.style.position = 'absolute';\r\n parentNode.style.left = '-10000px';\r\n parentNode.style.top = '-10000px'; // Large font size makes even subtle changes obvious\r\n\r\n parentNode.style.fontSize = '300px'; // Reset any font properties\r\n\r\n parentNode.style.fontVariant = 'normal';\r\n parentNode.style.fontStyle = 'normal';\r\n parentNode.style.fontWeight = 'normal';\r\n parentNode.style.letterSpacing = '0';\r\n parentNode.appendChild(node);\r\n document.body.appendChild(parentNode); // Remember width with no applied web font\r\n\r\n var width = node.offsetWidth;\r\n node.style.fontFamily = trimFontOptions(font) + ', ' + family;\r\n return {\r\n node: node,\r\n w: width,\r\n parent: parentNode\r\n };\r\n }\r\n\r\n function checkLoadedFonts() {\r\n var i;\r\n var len = this.fonts.length;\r\n var node;\r\n var w;\r\n var loadedCount = len;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.fonts[i].loaded) {\r\n loadedCount -= 1;\r\n } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {\r\n this.fonts[i].loaded = true;\r\n } else {\r\n node = this.fonts[i].monoCase.node;\r\n w = this.fonts[i].monoCase.w;\r\n\r\n if (node.offsetWidth !== w) {\r\n loadedCount -= 1;\r\n this.fonts[i].loaded = true;\r\n } else {\r\n node = this.fonts[i].sansCase.node;\r\n w = this.fonts[i].sansCase.w;\r\n\r\n if (node.offsetWidth !== w) {\r\n loadedCount -= 1;\r\n this.fonts[i].loaded = true;\r\n }\r\n }\r\n\r\n if (this.fonts[i].loaded) {\r\n this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);\r\n this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);\r\n }\r\n }\r\n }\r\n\r\n if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {\r\n setTimeout(this.checkLoadedFontsBinded, 20);\r\n } else {\r\n setTimeout(this.setIsLoadedBinded, 10);\r\n }\r\n }\r\n\r\n function createHelper(fontData, def) {\r\n var engine = document.body && def ? 'svg' : 'canvas';\r\n var helper;\r\n var fontProps = getFontProperties(fontData);\r\n\r\n if (engine === 'svg') {\r\n var tHelper = createNS('text');\r\n tHelper.style.fontSize = '100px'; // tHelper.style.fontFamily = fontData.fFamily;\r\n\r\n tHelper.setAttribute('font-family', fontData.fFamily);\r\n tHelper.setAttribute('font-style', fontProps.style);\r\n tHelper.setAttribute('font-weight', fontProps.weight);\r\n tHelper.textContent = '1';\r\n\r\n if (fontData.fClass) {\r\n tHelper.style.fontFamily = 'inherit';\r\n tHelper.setAttribute('class', fontData.fClass);\r\n } else {\r\n tHelper.style.fontFamily = fontData.fFamily;\r\n }\r\n\r\n def.appendChild(tHelper);\r\n helper = tHelper;\r\n } else {\r\n var tCanvasHelper = new OffscreenCanvas(500, 500).getContext('2d');\r\n tCanvasHelper.font = fontProps.style + ' ' + fontProps.weight + ' 100px ' + fontData.fFamily;\r\n helper = tCanvasHelper;\r\n }\r\n\r\n function measure(text) {\r\n if (engine === 'svg') {\r\n helper.textContent = text;\r\n return helper.getComputedTextLength();\r\n }\r\n\r\n return helper.measureText(text).width;\r\n }\r\n\r\n return {\r\n measureText: measure\r\n };\r\n }\r\n\r\n function addFonts(fontData, defs) {\r\n if (!fontData) {\r\n this.isLoaded = true;\r\n return;\r\n }\r\n\r\n if (this.chars) {\r\n this.isLoaded = true;\r\n this.fonts = fontData.list;\r\n return;\r\n }\r\n\r\n if (!document.body) {\r\n this.isLoaded = true;\r\n fontData.list.forEach(function (data) {\r\n data.helper = createHelper(data);\r\n data.cache = {};\r\n });\r\n this.fonts = fontData.list;\r\n return;\r\n }\r\n\r\n var fontArr = fontData.list;\r\n var i;\r\n var len = fontArr.length;\r\n var _pendingFonts = len;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n var shouldLoadFont = true;\r\n var loadedSelector;\r\n var j;\r\n fontArr[i].loaded = false;\r\n fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');\r\n fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');\r\n\r\n if (!fontArr[i].fPath) {\r\n fontArr[i].loaded = true;\r\n _pendingFonts -= 1;\r\n } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {\r\n loadedSelector = document.querySelectorAll('style[f-forigin=\"p\"][f-family=\"' + fontArr[i].fFamily + '\"], style[f-origin=\"3\"][f-family=\"' + fontArr[i].fFamily + '\"]');\r\n\r\n if (loadedSelector.length > 0) {\r\n shouldLoadFont = false;\r\n }\r\n\r\n if (shouldLoadFont) {\r\n var s = createTag('style');\r\n s.setAttribute('f-forigin', fontArr[i].fOrigin);\r\n s.setAttribute('f-origin', fontArr[i].origin);\r\n s.setAttribute('f-family', fontArr[i].fFamily);\r\n s.type = 'text/css';\r\n s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + \"; font-style: normal; src: url('\" + fontArr[i].fPath + \"');}\";\r\n defs.appendChild(s);\r\n }\r\n } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {\r\n loadedSelector = document.querySelectorAll('link[f-forigin=\"g\"], link[f-origin=\"1\"]');\r\n\r\n for (j = 0; j < loadedSelector.length; j += 1) {\r\n if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {\r\n // Font is already loaded\r\n shouldLoadFont = false;\r\n }\r\n }\r\n\r\n if (shouldLoadFont) {\r\n var l = createTag('link');\r\n l.setAttribute('f-forigin', fontArr[i].fOrigin);\r\n l.setAttribute('f-origin', fontArr[i].origin);\r\n l.type = 'text/css';\r\n l.rel = 'stylesheet';\r\n l.href = fontArr[i].fPath;\r\n document.body.appendChild(l);\r\n }\r\n } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {\r\n loadedSelector = document.querySelectorAll('script[f-forigin=\"t\"], script[f-origin=\"2\"]');\r\n\r\n for (j = 0; j < loadedSelector.length; j += 1) {\r\n if (fontArr[i].fPath === loadedSelector[j].src) {\r\n // Font is already loaded\r\n shouldLoadFont = false;\r\n }\r\n }\r\n\r\n if (shouldLoadFont) {\r\n var sc = createTag('link');\r\n sc.setAttribute('f-forigin', fontArr[i].fOrigin);\r\n sc.setAttribute('f-origin', fontArr[i].origin);\r\n sc.setAttribute('rel', 'stylesheet');\r\n sc.setAttribute('href', fontArr[i].fPath);\r\n defs.appendChild(sc);\r\n }\r\n }\r\n\r\n fontArr[i].helper = createHelper(fontArr[i], defs);\r\n fontArr[i].cache = {};\r\n this.fonts.push(fontArr[i]);\r\n }\r\n\r\n if (_pendingFonts === 0) {\r\n this.isLoaded = true;\r\n } else {\r\n // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.\r\n // Adding this timeout seems to fix it\r\n setTimeout(this.checkLoadedFonts.bind(this), 100);\r\n }\r\n }\r\n\r\n function addChars(chars) {\r\n if (!chars) {\r\n return;\r\n }\r\n\r\n if (!this.chars) {\r\n this.chars = [];\r\n }\r\n\r\n var i;\r\n var len = chars.length;\r\n var j;\r\n var jLen = this.chars.length;\r\n var found;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n j = 0;\r\n found = false;\r\n\r\n while (j < jLen) {\r\n if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {\r\n found = true;\r\n }\r\n\r\n j += 1;\r\n }\r\n\r\n if (!found) {\r\n this.chars.push(chars[i]);\r\n jLen += 1;\r\n }\r\n }\r\n }\r\n\r\n function getCharData(_char, style, font) {\r\n var i = 0;\r\n var len = this.chars.length;\r\n\r\n while (i < len) {\r\n if (this.chars[i].ch === _char && this.chars[i].style === style && this.chars[i].fFamily === font) {\r\n return this.chars[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if ((typeof _char === 'string' && _char.charCodeAt(0) !== 13 || !_char) && console && console.warn // eslint-disable-line no-console\r\n && !this._warned) {\r\n this._warned = true;\r\n console.warn('Missing character from exported characters list: ', _char, style, font); // eslint-disable-line no-console\r\n }\r\n\r\n return emptyChar;\r\n }\r\n\r\n function measureText(_char2, fontName, size) {\r\n var fontData = this.getFontByName(fontName);\r\n\r\n var index = _char2.charCodeAt(0);\r\n\r\n if (!fontData.cache[index + 1]) {\r\n var tHelper = fontData.helper;\r\n\r\n if (_char2 === ' ') {\r\n var doubleSize = tHelper.measureText('|' + _char2 + '|');\r\n var singleSize = tHelper.measureText('||');\r\n fontData.cache[index + 1] = (doubleSize - singleSize) / 100;\r\n } else {\r\n fontData.cache[index + 1] = tHelper.measureText(_char2) / 100;\r\n }\r\n }\r\n\r\n return fontData.cache[index + 1] * size;\r\n }\r\n\r\n function getFontByName(name) {\r\n var i = 0;\r\n var len = this.fonts.length;\r\n\r\n while (i < len) {\r\n if (this.fonts[i].fName === name) {\r\n return this.fonts[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return this.fonts[0];\r\n }\r\n\r\n function isModifier(firstCharCode, secondCharCode) {\r\n var sum = firstCharCode.toString(16) + secondCharCode.toString(16);\r\n return surrogateModifiers.indexOf(sum) !== -1;\r\n }\r\n\r\n function isZeroWidthJoiner(firstCharCode, secondCharCode) {\r\n if (!secondCharCode) {\r\n return firstCharCode === zeroWidthJoiner[1];\r\n }\r\n\r\n return firstCharCode === zeroWidthJoiner[0] && secondCharCode === zeroWidthJoiner[1];\r\n }\r\n\r\n function isCombinedCharacter(_char3) {\r\n return combinedCharacters.indexOf(_char3) !== -1;\r\n }\r\n\r\n function setIsLoaded() {\r\n this.isLoaded = true;\r\n }\r\n\r\n var Font = function Font() {\r\n this.fonts = [];\r\n this.chars = null;\r\n this.typekitLoaded = 0;\r\n this.isLoaded = false;\r\n this._warned = false;\r\n this.initTime = Date.now();\r\n this.setIsLoadedBinded = this.setIsLoaded.bind(this);\r\n this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);\r\n };\r\n\r\n Font.isModifier = isModifier;\r\n Font.isZeroWidthJoiner = isZeroWidthJoiner;\r\n Font.isCombinedCharacter = isCombinedCharacter;\r\n var fontPrototype = {\r\n addChars: addChars,\r\n addFonts: addFonts,\r\n getCharData: getCharData,\r\n getFontByName: getFontByName,\r\n measureText: measureText,\r\n checkLoadedFonts: checkLoadedFonts,\r\n setIsLoaded: setIsLoaded\r\n };\r\n Font.prototype = fontPrototype;\r\n return Font;\r\n }();\r\n\r\n function RenderableElement() {}\r\n\r\n RenderableElement.prototype = {\r\n initRenderable: function initRenderable() {\r\n // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange\r\n this.isInRange = false; // layer's display state\r\n\r\n this.hidden = false; // If layer's transparency equals 0, it can be hidden\r\n\r\n this.isTransparent = false; // list of animated components\r\n\r\n this.renderableComponents = [];\r\n },\r\n addRenderableComponent: function addRenderableComponent(component) {\r\n if (this.renderableComponents.indexOf(component) === -1) {\r\n this.renderableComponents.push(component);\r\n }\r\n },\r\n removeRenderableComponent: function removeRenderableComponent(component) {\r\n if (this.renderableComponents.indexOf(component) !== -1) {\r\n this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);\r\n }\r\n },\r\n prepareRenderableFrame: function prepareRenderableFrame(num) {\r\n this.checkLayerLimits(num);\r\n },\r\n checkTransparency: function checkTransparency() {\r\n if (this.finalTransform.mProp.o.v <= 0) {\r\n if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {\r\n this.isTransparent = true;\r\n this.hide();\r\n }\r\n } else if (this.isTransparent) {\r\n this.isTransparent = false;\r\n this.show();\r\n }\r\n },\r\n\r\n /**\r\n * @function\r\n * Initializes frame related properties.\r\n *\r\n * @param {number} num\r\n * current frame number in Layer's time\r\n *\r\n */\r\n checkLayerLimits: function checkLayerLimits(num) {\r\n if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {\r\n if (this.isInRange !== true) {\r\n this.globalData._mdf = true;\r\n this._mdf = true;\r\n this.isInRange = true;\r\n this.show();\r\n }\r\n } else if (this.isInRange !== false) {\r\n this.globalData._mdf = true;\r\n this.isInRange = false;\r\n this.hide();\r\n }\r\n },\r\n renderRenderable: function renderRenderable() {\r\n var i;\r\n var len = this.renderableComponents.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.renderableComponents[i].renderFrame(this._isFirstFrame);\r\n }\r\n /* this.maskManager.renderFrame(this.finalTransform.mat);\r\n this.renderableEffectsManager.renderFrame(this._isFirstFrame); */\r\n\r\n },\r\n sourceRectAtTime: function sourceRectAtTime() {\r\n return {\r\n top: 0,\r\n left: 0,\r\n width: 100,\r\n height: 100\r\n };\r\n },\r\n getLayerSize: function getLayerSize() {\r\n if (this.data.ty === 5) {\r\n return {\r\n w: this.data.textData.width,\r\n h: this.data.textData.height\r\n };\r\n }\r\n\r\n return {\r\n w: this.data.width,\r\n h: this.data.height\r\n };\r\n }\r\n };\r\n\r\n var getBlendMode = function () {\r\n var blendModeEnums = {\r\n 0: 'source-over',\r\n 1: 'multiply',\r\n 2: 'screen',\r\n 3: 'overlay',\r\n 4: 'darken',\r\n 5: 'lighten',\r\n 6: 'color-dodge',\r\n 7: 'color-burn',\r\n 8: 'hard-light',\r\n 9: 'soft-light',\r\n 10: 'difference',\r\n 11: 'exclusion',\r\n 12: 'hue',\r\n 13: 'saturation',\r\n 14: 'color',\r\n 15: 'luminosity'\r\n };\r\n return function (mode) {\r\n return blendModeEnums[mode] || '';\r\n };\r\n }();\r\n\r\n function SliderEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);\r\n }\r\n\r\n function AngleEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);\r\n }\r\n\r\n function ColorEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);\r\n }\r\n\r\n function PointEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);\r\n }\r\n\r\n function LayerIndexEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);\r\n }\r\n\r\n function MaskIndexEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);\r\n }\r\n\r\n function CheckboxEffect(data, elem, container) {\r\n this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);\r\n }\r\n\r\n function NoValueEffect() {\r\n this.p = {};\r\n }\r\n\r\n function EffectsManager(data, element) {\r\n var effects = data.ef || [];\r\n this.effectElements = [];\r\n var i;\r\n var len = effects.length;\r\n var effectItem;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n effectItem = new GroupEffect(effects[i], element);\r\n this.effectElements.push(effectItem);\r\n }\r\n }\r\n\r\n function GroupEffect(data, element) {\r\n this.init(data, element);\r\n }\r\n\r\n extendPrototype([DynamicPropertyContainer], GroupEffect);\r\n GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;\r\n\r\n GroupEffect.prototype.init = function (data, element) {\r\n this.data = data;\r\n this.effectElements = [];\r\n this.initDynamicPropertyContainer(element);\r\n var i;\r\n var len = this.data.ef.length;\r\n var eff;\r\n var effects = this.data.ef;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n eff = null;\r\n\r\n switch (effects[i].ty) {\r\n case 0:\r\n eff = new SliderEffect(effects[i], element, this);\r\n break;\r\n\r\n case 1:\r\n eff = new AngleEffect(effects[i], element, this);\r\n break;\r\n\r\n case 2:\r\n eff = new ColorEffect(effects[i], element, this);\r\n break;\r\n\r\n case 3:\r\n eff = new PointEffect(effects[i], element, this);\r\n break;\r\n\r\n case 4:\r\n case 7:\r\n eff = new CheckboxEffect(effects[i], element, this);\r\n break;\r\n\r\n case 10:\r\n eff = new LayerIndexEffect(effects[i], element, this);\r\n break;\r\n\r\n case 11:\r\n eff = new MaskIndexEffect(effects[i], element, this);\r\n break;\r\n\r\n case 5:\r\n eff = new EffectsManager(effects[i], element, this);\r\n break;\r\n // case 6:\r\n\r\n default:\r\n eff = new NoValueEffect(effects[i], element, this);\r\n break;\r\n }\r\n\r\n if (eff) {\r\n this.effectElements.push(eff);\r\n }\r\n }\r\n };\r\n\r\n function BaseElement() {}\r\n\r\n BaseElement.prototype = {\r\n checkMasks: function checkMasks() {\r\n if (!this.data.hasMask) {\r\n return false;\r\n }\r\n\r\n var i = 0;\r\n var len = this.data.masksProperties.length;\r\n\r\n while (i < len) {\r\n if (this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false) {\r\n return true;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return false;\r\n },\r\n initExpressions: function initExpressions() {\r\n var expressionsInterfaces = getExpressionInterfaces();\r\n\r\n if (!expressionsInterfaces) {\r\n return;\r\n }\r\n\r\n var LayerExpressionInterface = expressionsInterfaces('layer');\r\n var EffectsExpressionInterface = expressionsInterfaces('effects');\r\n var ShapeExpressionInterface = expressionsInterfaces('shape');\r\n var TextExpressionInterface = expressionsInterfaces('text');\r\n var CompExpressionInterface = expressionsInterfaces('comp');\r\n this.layerInterface = LayerExpressionInterface(this);\r\n\r\n if (this.data.hasMask && this.maskManager) {\r\n this.layerInterface.registerMaskInterface(this.maskManager);\r\n }\r\n\r\n var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);\r\n this.layerInterface.registerEffectsInterface(effectsInterface);\r\n\r\n if (this.data.ty === 0 || this.data.xt) {\r\n this.compInterface = CompExpressionInterface(this);\r\n } else if (this.data.ty === 4) {\r\n this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);\r\n this.layerInterface.content = this.layerInterface.shapeInterface;\r\n } else if (this.data.ty === 5) {\r\n this.layerInterface.textInterface = TextExpressionInterface(this);\r\n this.layerInterface.text = this.layerInterface.textInterface;\r\n }\r\n },\r\n setBlendMode: function setBlendMode() {\r\n var blendModeValue = getBlendMode(this.data.bm);\r\n var elem = this.baseElement || this.layerElement;\r\n elem.style['mix-blend-mode'] = blendModeValue;\r\n },\r\n initBaseData: function initBaseData(data, globalData, comp) {\r\n this.globalData = globalData;\r\n this.comp = comp;\r\n this.data = data;\r\n this.layerId = createElementID(); // Stretch factor for old animations missing this property.\r\n\r\n if (!this.data.sr) {\r\n this.data.sr = 1;\r\n } // effects manager\r\n\r\n\r\n this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);\r\n },\r\n getType: function getType() {\r\n return this.type;\r\n },\r\n sourceRectAtTime: function sourceRectAtTime() {}\r\n };\r\n\r\n /**\r\n * @file\r\n * Handles element's layer frame update.\r\n * Checks layer in point and out point\r\n *\r\n */\r\n function FrameElement() {}\r\n\r\n FrameElement.prototype = {\r\n /**\r\n * @function\r\n * Initializes frame related properties.\r\n *\r\n */\r\n initFrame: function initFrame() {\r\n // set to true when inpoint is rendered\r\n this._isFirstFrame = false; // list of animated properties\r\n\r\n this.dynamicProperties = []; // If layer has been modified in current tick this will be true\r\n\r\n this._mdf = false;\r\n },\r\n\r\n /**\r\n * @function\r\n * Calculates all dynamic values\r\n *\r\n * @param {number} num\r\n * current frame number in Layer's time\r\n * @param {boolean} isVisible\r\n * if layers is currently in range\r\n *\r\n */\r\n prepareProperties: function prepareProperties(num, isVisible) {\r\n var i;\r\n var len = this.dynamicProperties.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (isVisible || this._isParent && this.dynamicProperties[i].propType === 'transform') {\r\n this.dynamicProperties[i].getValue();\r\n\r\n if (this.dynamicProperties[i]._mdf) {\r\n this.globalData._mdf = true;\r\n this._mdf = true;\r\n }\r\n }\r\n }\r\n },\r\n addDynamicProperty: function addDynamicProperty(prop) {\r\n if (this.dynamicProperties.indexOf(prop) === -1) {\r\n this.dynamicProperties.push(prop);\r\n }\r\n }\r\n };\r\n\r\n function FootageElement(data, globalData, comp) {\r\n this.initFrame();\r\n this.initRenderable();\r\n this.assetData = globalData.getAssetData(data.refId);\r\n this.footageData = globalData.imageLoader.getAsset(this.assetData);\r\n this.initBaseData(data, globalData, comp);\r\n }\r\n\r\n FootageElement.prototype.prepareFrame = function () {};\r\n\r\n extendPrototype([RenderableElement, BaseElement, FrameElement], FootageElement);\r\n\r\n FootageElement.prototype.getBaseElement = function () {\r\n return null;\r\n };\r\n\r\n FootageElement.prototype.renderFrame = function () {};\r\n\r\n FootageElement.prototype.destroy = function () {};\r\n\r\n FootageElement.prototype.initExpressions = function () {\r\n var expressionsInterfaces = getExpressionInterfaces();\r\n\r\n if (!expressionsInterfaces) {\r\n return;\r\n }\r\n\r\n var FootageInterface = expressionsInterfaces('footage');\r\n this.layerInterface = FootageInterface(this);\r\n };\r\n\r\n FootageElement.prototype.getFootageData = function () {\r\n return this.footageData;\r\n };\r\n\r\n function AudioElement(data, globalData, comp) {\r\n this.initFrame();\r\n this.initRenderable();\r\n this.assetData = globalData.getAssetData(data.refId);\r\n this.initBaseData(data, globalData, comp);\r\n this._isPlaying = false;\r\n this._canPlay = false;\r\n var assetPath = this.globalData.getAssetsPath(this.assetData);\r\n this.audio = this.globalData.audioController.createAudio(assetPath);\r\n this._currentTime = 0;\r\n this.globalData.audioController.addAudio(this);\r\n this._volumeMultiplier = 1;\r\n this._volume = 1;\r\n this._previousVolume = null;\r\n this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {\r\n _placeholder: true\r\n };\r\n this.lv = PropertyFactory.getProp(this, data.au && data.au.lv ? data.au.lv : {\r\n k: [100]\r\n }, 1, 0.01, this);\r\n }\r\n\r\n AudioElement.prototype.prepareFrame = function (num) {\r\n this.prepareRenderableFrame(num, true);\r\n this.prepareProperties(num, true);\r\n\r\n if (!this.tm._placeholder) {\r\n var timeRemapped = this.tm.v;\r\n this._currentTime = timeRemapped;\r\n } else {\r\n this._currentTime = num / this.data.sr;\r\n }\r\n\r\n this._volume = this.lv.v[0];\r\n var totalVolume = this._volume * this._volumeMultiplier;\r\n\r\n if (this._previousVolume !== totalVolume) {\r\n this._previousVolume = totalVolume;\r\n this.audio.volume(totalVolume);\r\n }\r\n };\r\n\r\n extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);\r\n\r\n AudioElement.prototype.renderFrame = function () {\r\n if (this.isInRange && this._canPlay) {\r\n if (!this._isPlaying) {\r\n this.audio.play();\r\n this.audio.seek(this._currentTime / this.globalData.frameRate);\r\n this._isPlaying = true;\r\n } else if (!this.audio.playing() || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1) {\r\n this.audio.seek(this._currentTime / this.globalData.frameRate);\r\n }\r\n }\r\n };\r\n\r\n AudioElement.prototype.show = function () {// this.audio.play()\r\n };\r\n\r\n AudioElement.prototype.hide = function () {\r\n this.audio.pause();\r\n this._isPlaying = false;\r\n };\r\n\r\n AudioElement.prototype.pause = function () {\r\n this.audio.pause();\r\n this._isPlaying = false;\r\n this._canPlay = false;\r\n };\r\n\r\n AudioElement.prototype.resume = function () {\r\n this._canPlay = true;\r\n };\r\n\r\n AudioElement.prototype.setRate = function (rateValue) {\r\n this.audio.rate(rateValue);\r\n };\r\n\r\n AudioElement.prototype.volume = function (volumeValue) {\r\n this._volumeMultiplier = volumeValue;\r\n this._previousVolume = volumeValue * this._volume;\r\n this.audio.volume(this._previousVolume);\r\n };\r\n\r\n AudioElement.prototype.getBaseElement = function () {\r\n return null;\r\n };\r\n\r\n AudioElement.prototype.destroy = function () {};\r\n\r\n AudioElement.prototype.sourceRectAtTime = function () {};\r\n\r\n AudioElement.prototype.initExpressions = function () {};\r\n\r\n function BaseRenderer() {}\r\n\r\n BaseRenderer.prototype.checkLayers = function (num) {\r\n var i;\r\n var len = this.layers.length;\r\n var data;\r\n this.completeLayers = true;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (!this.elements[i]) {\r\n data = this.layers[i];\r\n\r\n if (data.ip - data.st <= num - this.layers[i].st && data.op - data.st > num - this.layers[i].st) {\r\n this.buildItem(i);\r\n }\r\n }\r\n\r\n this.completeLayers = this.elements[i] ? this.completeLayers : false;\r\n }\r\n\r\n this.checkPendingElements();\r\n };\r\n\r\n BaseRenderer.prototype.createItem = function (layer) {\r\n switch (layer.ty) {\r\n case 2:\r\n return this.createImage(layer);\r\n\r\n case 0:\r\n return this.createComp(layer);\r\n\r\n case 1:\r\n return this.createSolid(layer);\r\n\r\n case 3:\r\n return this.createNull(layer);\r\n\r\n case 4:\r\n return this.createShape(layer);\r\n\r\n case 5:\r\n return this.createText(layer);\r\n\r\n case 6:\r\n return this.createAudio(layer);\r\n\r\n case 13:\r\n return this.createCamera(layer);\r\n\r\n case 15:\r\n return this.createFootage(layer);\r\n\r\n default:\r\n return this.createNull(layer);\r\n }\r\n };\r\n\r\n BaseRenderer.prototype.createCamera = function () {\r\n throw new Error('You\\'re using a 3d camera. Try the html renderer.');\r\n };\r\n\r\n BaseRenderer.prototype.createAudio = function (data) {\r\n return new AudioElement(data, this.globalData, this);\r\n };\r\n\r\n BaseRenderer.prototype.createFootage = function (data) {\r\n return new FootageElement(data, this.globalData, this);\r\n };\r\n\r\n BaseRenderer.prototype.buildAllItems = function () {\r\n var i;\r\n var len = this.layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.buildItem(i);\r\n }\r\n\r\n this.checkPendingElements();\r\n };\r\n\r\n BaseRenderer.prototype.includeLayers = function (newLayers) {\r\n this.completeLayers = false;\r\n var i;\r\n var len = newLayers.length;\r\n var j;\r\n var jLen = this.layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n j = 0;\r\n\r\n while (j < jLen) {\r\n if (this.layers[j].id === newLayers[i].id) {\r\n this.layers[j] = newLayers[i];\r\n break;\r\n }\r\n\r\n j += 1;\r\n }\r\n }\r\n };\r\n\r\n BaseRenderer.prototype.setProjectInterface = function (pInterface) {\r\n this.globalData.projectInterface = pInterface;\r\n };\r\n\r\n BaseRenderer.prototype.initItems = function () {\r\n if (!this.globalData.progressiveLoad) {\r\n this.buildAllItems();\r\n }\r\n };\r\n\r\n BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {\r\n var elements = this.elements;\r\n var layers = this.layers;\r\n var i = 0;\r\n var len = layers.length;\r\n\r\n while (i < len) {\r\n if (layers[i].ind == parentName) {\r\n // eslint-disable-line eqeqeq\r\n if (!elements[i] || elements[i] === true) {\r\n this.buildItem(i);\r\n this.addPendingElement(element);\r\n } else {\r\n hierarchy.push(elements[i]);\r\n elements[i].setAsParent();\r\n\r\n if (layers[i].parent !== undefined) {\r\n this.buildElementParenting(element, layers[i].parent, hierarchy);\r\n } else {\r\n element.setHierarchy(hierarchy);\r\n }\r\n }\r\n }\r\n\r\n i += 1;\r\n }\r\n };\r\n\r\n BaseRenderer.prototype.addPendingElement = function (element) {\r\n this.pendingElements.push(element);\r\n };\r\n\r\n BaseRenderer.prototype.searchExtraCompositions = function (assets) {\r\n var i;\r\n var len = assets.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (assets[i].xt) {\r\n var comp = this.createComp(assets[i]);\r\n comp.initExpressions();\r\n this.globalData.projectInterface.registerComposition(comp);\r\n }\r\n }\r\n };\r\n\r\n BaseRenderer.prototype.getElementById = function (ind) {\r\n var i;\r\n var len = this.elements.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.elements[i].data.ind === ind) {\r\n return this.elements[i];\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n BaseRenderer.prototype.getElementByPath = function (path) {\r\n var pathValue = path.shift();\r\n var element;\r\n\r\n if (typeof pathValue === 'number') {\r\n element = this.elements[pathValue];\r\n } else {\r\n var i;\r\n var len = this.elements.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.elements[i].data.nm === pathValue) {\r\n element = this.elements[i];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (path.length === 0) {\r\n return element;\r\n }\r\n\r\n return element.getElementByPath(path);\r\n };\r\n\r\n BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {\r\n this.globalData.fontManager = new FontManager();\r\n this.globalData.fontManager.addChars(animData.chars);\r\n this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);\r\n this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);\r\n this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);\r\n this.globalData.imageLoader = this.animationItem.imagePreloader;\r\n this.globalData.audioController = this.animationItem.audioController;\r\n this.globalData.frameId = 0;\r\n this.globalData.frameRate = animData.fr;\r\n this.globalData.nm = animData.nm;\r\n this.globalData.compSize = {\r\n w: animData.w,\r\n h: animData.h\r\n };\r\n };\r\n\r\n function TransformElement() {}\r\n\r\n TransformElement.prototype = {\r\n initTransform: function initTransform() {\r\n this.finalTransform = {\r\n mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {\r\n o: 0\r\n },\r\n _matMdf: false,\r\n _opMdf: false,\r\n mat: new Matrix()\r\n };\r\n\r\n if (this.data.ao) {\r\n this.finalTransform.mProp.autoOriented = true;\r\n } // TODO: check TYPE 11: Guided elements\r\n\r\n\r\n if (this.data.ty !== 11) {// this.createElements();\r\n }\r\n },\r\n renderTransform: function renderTransform() {\r\n this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;\r\n this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;\r\n\r\n if (this.hierarchy) {\r\n var mat;\r\n var finalMat = this.finalTransform.mat;\r\n var i = 0;\r\n var len = this.hierarchy.length; // Checking if any of the transformation matrices in the hierarchy chain has changed.\r\n\r\n if (!this.finalTransform._matMdf) {\r\n while (i < len) {\r\n if (this.hierarchy[i].finalTransform.mProp._mdf) {\r\n this.finalTransform._matMdf = true;\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n }\r\n\r\n if (this.finalTransform._matMdf) {\r\n mat = this.finalTransform.mProp.v.props;\r\n finalMat.cloneFromProps(mat);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n mat = this.hierarchy[i].finalTransform.mProp.v.props;\r\n finalMat.transform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5], mat[6], mat[7], mat[8], mat[9], mat[10], mat[11], mat[12], mat[13], mat[14], mat[15]);\r\n }\r\n }\r\n }\r\n },\r\n globalToLocal: function globalToLocal(pt) {\r\n var transforms = [];\r\n transforms.push(this.finalTransform);\r\n var flag = true;\r\n var comp = this.comp;\r\n\r\n while (flag) {\r\n if (comp.finalTransform) {\r\n if (comp.data.hasMask) {\r\n transforms.splice(0, 0, comp.finalTransform);\r\n }\r\n\r\n comp = comp.comp;\r\n } else {\r\n flag = false;\r\n }\r\n }\r\n\r\n var i;\r\n var len = transforms.length;\r\n var ptNew;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ptNew = transforms[i].mat.applyToPointArray(0, 0, 0); // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);\r\n\r\n pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];\r\n }\r\n\r\n return pt;\r\n },\r\n mHelper: new Matrix()\r\n };\r\n\r\n function MaskElement(data, element, globalData) {\r\n this.data = data;\r\n this.element = element;\r\n this.globalData = globalData;\r\n this.storedData = [];\r\n this.masksProperties = this.data.masksProperties || [];\r\n this.maskElement = null;\r\n var defs = this.globalData.defs;\r\n var i;\r\n var len = this.masksProperties ? this.masksProperties.length : 0;\r\n this.viewData = createSizedArray(len);\r\n this.solidPath = '';\r\n var path;\r\n var properties = this.masksProperties;\r\n var count = 0;\r\n var currentMasks = [];\r\n var j;\r\n var jLen;\r\n var layerId = createElementID();\r\n var rect;\r\n var expansor;\r\n var feMorph;\r\n var x;\r\n var maskType = 'clipPath';\r\n var maskRef = 'clip-path';\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (properties[i].mode !== 'a' && properties[i].mode !== 'n' || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {\r\n maskType = 'mask';\r\n maskRef = 'mask';\r\n }\r\n\r\n if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {\r\n rect = createNS('rect');\r\n rect.setAttribute('fill', '#ffffff');\r\n rect.setAttribute('width', this.element.comp.data.w || 0);\r\n rect.setAttribute('height', this.element.comp.data.h || 0);\r\n currentMasks.push(rect);\r\n } else {\r\n rect = null;\r\n }\r\n\r\n path = createNS('path');\r\n\r\n if (properties[i].mode === 'n') {\r\n // TODO move this to a factory or to a constructor\r\n this.viewData[i] = {\r\n op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),\r\n prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),\r\n elem: path,\r\n lastPath: ''\r\n };\r\n defs.appendChild(path);\r\n } else {\r\n count += 1;\r\n path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');\r\n path.setAttribute('clip-rule', 'nonzero');\r\n var filterID;\r\n\r\n if (properties[i].x.k !== 0) {\r\n maskType = 'mask';\r\n maskRef = 'mask';\r\n x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);\r\n filterID = createElementID();\r\n expansor = createNS('filter');\r\n expansor.setAttribute('id', filterID);\r\n feMorph = createNS('feMorphology');\r\n feMorph.setAttribute('operator', 'erode');\r\n feMorph.setAttribute('in', 'SourceGraphic');\r\n feMorph.setAttribute('radius', '0');\r\n expansor.appendChild(feMorph);\r\n defs.appendChild(expansor);\r\n path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');\r\n } else {\r\n feMorph = null;\r\n x = null;\r\n } // TODO move this to a factory or to a constructor\r\n\r\n\r\n this.storedData[i] = {\r\n elem: path,\r\n x: x,\r\n expan: feMorph,\r\n lastPath: '',\r\n lastOperator: '',\r\n filterId: filterID,\r\n lastRadius: 0\r\n };\r\n\r\n if (properties[i].mode === 'i') {\r\n jLen = currentMasks.length;\r\n var g = createNS('g');\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n g.appendChild(currentMasks[j]);\r\n }\r\n\r\n var mask = createNS('mask');\r\n mask.setAttribute('mask-type', 'alpha');\r\n mask.setAttribute('id', layerId + '_' + count);\r\n mask.appendChild(path);\r\n defs.appendChild(mask);\r\n g.setAttribute('mask', 'url(' + getLocationHref() + '#' + layerId + '_' + count + ')');\r\n currentMasks.length = 0;\r\n currentMasks.push(g);\r\n } else {\r\n currentMasks.push(path);\r\n }\r\n\r\n if (properties[i].inv && !this.solidPath) {\r\n this.solidPath = this.createLayerSolidPath();\r\n } // TODO move this to a factory or to a constructor\r\n\r\n\r\n this.viewData[i] = {\r\n elem: path,\r\n lastPath: '',\r\n op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),\r\n prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),\r\n invRect: rect\r\n };\r\n\r\n if (!this.viewData[i].prop.k) {\r\n this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);\r\n }\r\n }\r\n }\r\n\r\n this.maskElement = createNS(maskType);\r\n len = currentMasks.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.maskElement.appendChild(currentMasks[i]);\r\n }\r\n\r\n if (count > 0) {\r\n this.maskElement.setAttribute('id', layerId);\r\n this.element.maskedElement.setAttribute(maskRef, 'url(' + getLocationHref() + '#' + layerId + ')');\r\n defs.appendChild(this.maskElement);\r\n }\r\n\r\n if (this.viewData.length) {\r\n this.element.addRenderableComponent(this);\r\n }\r\n }\r\n\r\n MaskElement.prototype.getMaskProperty = function (pos) {\r\n return this.viewData[pos].prop;\r\n };\r\n\r\n MaskElement.prototype.renderFrame = function (isFirstFrame) {\r\n var finalMat = this.element.finalTransform.mat;\r\n var i;\r\n var len = this.masksProperties.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.viewData[i].prop._mdf || isFirstFrame) {\r\n this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);\r\n }\r\n\r\n if (this.viewData[i].op._mdf || isFirstFrame) {\r\n this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);\r\n }\r\n\r\n if (this.masksProperties[i].mode !== 'n') {\r\n if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {\r\n this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());\r\n }\r\n\r\n if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {\r\n var feMorph = this.storedData[i].expan;\r\n\r\n if (this.storedData[i].x.v < 0) {\r\n if (this.storedData[i].lastOperator !== 'erode') {\r\n this.storedData[i].lastOperator = 'erode';\r\n this.storedData[i].elem.setAttribute('filter', 'url(' + getLocationHref() + '#' + this.storedData[i].filterId + ')');\r\n }\r\n\r\n feMorph.setAttribute('radius', -this.storedData[i].x.v);\r\n } else {\r\n if (this.storedData[i].lastOperator !== 'dilate') {\r\n this.storedData[i].lastOperator = 'dilate';\r\n this.storedData[i].elem.setAttribute('filter', null);\r\n }\r\n\r\n this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n MaskElement.prototype.getMaskelement = function () {\r\n return this.maskElement;\r\n };\r\n\r\n MaskElement.prototype.createLayerSolidPath = function () {\r\n var path = 'M0,0 ';\r\n path += ' h' + this.globalData.compSize.w;\r\n path += ' v' + this.globalData.compSize.h;\r\n path += ' h-' + this.globalData.compSize.w;\r\n path += ' v-' + this.globalData.compSize.h + ' ';\r\n return path;\r\n };\r\n\r\n MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {\r\n var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];\r\n var i;\r\n var len;\r\n len = pathNodes._length;\r\n\r\n for (i = 1; i < len; i += 1) {\r\n // pathString += \" C\"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + \" \"+pathNodes.i[i][0]+','+pathNodes.i[i][1] + \" \"+pathNodes.v[i][0]+','+pathNodes.v[i][1];\r\n pathString += ' C' + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + ' ' + pathNodes.i[i][0] + ',' + pathNodes.i[i][1] + ' ' + pathNodes.v[i][0] + ',' + pathNodes.v[i][1];\r\n } // pathString += \" C\"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + \" \"+pathNodes.i[0][0]+','+pathNodes.i[0][1] + \" \"+pathNodes.v[0][0]+','+pathNodes.v[0][1];\r\n\r\n\r\n if (pathNodes.c && len > 1) {\r\n pathString += ' C' + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + ' ' + pathNodes.i[0][0] + ',' + pathNodes.i[0][1] + ' ' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];\r\n } // pathNodes.__renderedString = pathString;\r\n\r\n\r\n if (viewData.lastPath !== pathString) {\r\n var pathShapeValue = '';\r\n\r\n if (viewData.elem) {\r\n if (pathNodes.c) {\r\n pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;\r\n }\r\n\r\n viewData.elem.setAttribute('d', pathShapeValue);\r\n }\r\n\r\n viewData.lastPath = pathString;\r\n }\r\n };\r\n\r\n MaskElement.prototype.destroy = function () {\r\n this.element = null;\r\n this.globalData = null;\r\n this.maskElement = null;\r\n this.data = null;\r\n this.masksProperties = null;\r\n };\r\n\r\n var filtersFactory = function () {\r\n var ob = {};\r\n ob.createFilter = createFilter;\r\n ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;\r\n\r\n function createFilter(filId, skipCoordinates) {\r\n var fil = createNS('filter');\r\n fil.setAttribute('id', filId);\r\n\r\n if (skipCoordinates !== true) {\r\n fil.setAttribute('filterUnits', 'objectBoundingBox');\r\n fil.setAttribute('x', '0%');\r\n fil.setAttribute('y', '0%');\r\n fil.setAttribute('width', '100%');\r\n fil.setAttribute('height', '100%');\r\n }\r\n\r\n return fil;\r\n }\r\n\r\n function createAlphaToLuminanceFilter() {\r\n var feColorMatrix = createNS('feColorMatrix');\r\n feColorMatrix.setAttribute('type', 'matrix');\r\n feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');\r\n feColorMatrix.setAttribute('values', '0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1');\r\n return feColorMatrix;\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n var featureSupport = function () {\r\n var ob = {\r\n maskType: true,\r\n svgLumaHidden: true,\r\n offscreenCanvas: typeof OffscreenCanvas !== 'undefined'\r\n };\r\n\r\n if (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\\/\\d./i.test(navigator.userAgent)) {\r\n ob.maskType = false;\r\n }\r\n\r\n if (/firefox/i.test(navigator.userAgent)) {\r\n ob.svgLumaHidden = false;\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n var registeredEffects = {};\r\n var idPrefix = 'filter_result_';\r\n\r\n function SVGEffects(elem) {\r\n var i;\r\n var source = 'SourceGraphic';\r\n var len = elem.data.ef ? elem.data.ef.length : 0;\r\n var filId = createElementID();\r\n var fil = filtersFactory.createFilter(filId, true);\r\n var count = 0;\r\n this.filters = [];\r\n var filterManager;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n filterManager = null;\r\n var type = elem.data.ef[i].ty;\r\n\r\n if (registeredEffects[type]) {\r\n var Effect = registeredEffects[type].effect;\r\n filterManager = new Effect(fil, elem.effectsManager.effectElements[i], elem, idPrefix + count, source);\r\n source = idPrefix + count;\r\n\r\n if (registeredEffects[type].countsAsEffect) {\r\n count += 1;\r\n }\r\n }\r\n\r\n if (filterManager) {\r\n this.filters.push(filterManager);\r\n }\r\n }\r\n\r\n if (count) {\r\n elem.globalData.defs.appendChild(fil);\r\n elem.layerElement.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')');\r\n }\r\n\r\n if (this.filters.length) {\r\n elem.addRenderableComponent(this);\r\n }\r\n }\r\n\r\n SVGEffects.prototype.renderFrame = function (_isFirstFrame) {\r\n var i;\r\n var len = this.filters.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.filters[i].renderFrame(_isFirstFrame);\r\n }\r\n };\r\n\r\n function registerEffect(id, effect, countsAsEffect) {\r\n registeredEffects[id] = {\r\n effect: effect,\r\n countsAsEffect: countsAsEffect\r\n };\r\n }\r\n\r\n function SVGBaseElement() {}\r\n\r\n SVGBaseElement.prototype = {\r\n initRendererElement: function initRendererElement() {\r\n this.layerElement = createNS('g');\r\n },\r\n createContainerElements: function createContainerElements() {\r\n this.matteElement = createNS('g');\r\n this.transformedElement = this.layerElement;\r\n this.maskedElement = this.layerElement;\r\n this._sizeChanged = false;\r\n var layerElementParent = null; // If this layer acts as a mask for the following layer\r\n\r\n if (this.data.td) {\r\n this.matteMasks = {};\r\n var gg = createNS('g');\r\n gg.setAttribute('id', this.layerId);\r\n gg.appendChild(this.layerElement);\r\n layerElementParent = gg;\r\n this.globalData.defs.appendChild(gg);\r\n } else if (this.data.tt) {\r\n this.matteElement.appendChild(this.layerElement);\r\n layerElementParent = this.matteElement;\r\n this.baseElement = this.matteElement;\r\n } else {\r\n this.baseElement = this.layerElement;\r\n }\r\n\r\n if (this.data.ln) {\r\n this.layerElement.setAttribute('id', this.data.ln);\r\n }\r\n\r\n if (this.data.cl) {\r\n this.layerElement.setAttribute('class', this.data.cl);\r\n } // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped\r\n\r\n\r\n if (this.data.ty === 0 && !this.data.hd) {\r\n var cp = createNS('clipPath');\r\n var pt = createNS('path');\r\n pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');\r\n var clipId = createElementID();\r\n cp.setAttribute('id', clipId);\r\n cp.appendChild(pt);\r\n this.globalData.defs.appendChild(cp);\r\n\r\n if (this.checkMasks()) {\r\n var cpGroup = createNS('g');\r\n cpGroup.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + clipId + ')');\r\n cpGroup.appendChild(this.layerElement);\r\n this.transformedElement = cpGroup;\r\n\r\n if (layerElementParent) {\r\n layerElementParent.appendChild(this.transformedElement);\r\n } else {\r\n this.baseElement = this.transformedElement;\r\n }\r\n } else {\r\n this.layerElement.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + clipId + ')');\r\n }\r\n }\r\n\r\n if (this.data.bm !== 0) {\r\n this.setBlendMode();\r\n }\r\n },\r\n renderElement: function renderElement() {\r\n if (this.finalTransform._matMdf) {\r\n this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());\r\n }\r\n\r\n if (this.finalTransform._opMdf) {\r\n this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);\r\n }\r\n },\r\n destroyBaseElement: function destroyBaseElement() {\r\n this.layerElement = null;\r\n this.matteElement = null;\r\n this.maskManager.destroy();\r\n },\r\n getBaseElement: function getBaseElement() {\r\n if (this.data.hd) {\r\n return null;\r\n }\r\n\r\n return this.baseElement;\r\n },\r\n createRenderableComponents: function createRenderableComponents() {\r\n this.maskManager = new MaskElement(this.data, this, this.globalData);\r\n this.renderableEffectsManager = new SVGEffects(this);\r\n },\r\n getMatte: function getMatte(matteType) {\r\n // This should not be a common case. But for backward compatibility, we'll create the matte object.\r\n // It solves animations that have two consecutive layers marked as matte masks.\r\n // Which is an undefined behavior in AE.\r\n if (!this.matteMasks) {\r\n this.matteMasks = {};\r\n }\r\n\r\n if (!this.matteMasks[matteType]) {\r\n var id = this.layerId + '_' + matteType;\r\n var filId;\r\n var fil;\r\n var useElement;\r\n var gg;\r\n\r\n if (matteType === 1 || matteType === 3) {\r\n var masker = createNS('mask');\r\n masker.setAttribute('id', id);\r\n masker.setAttribute('mask-type', matteType === 3 ? 'luminance' : 'alpha');\r\n useElement = createNS('use');\r\n useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + this.layerId);\r\n masker.appendChild(useElement);\r\n this.globalData.defs.appendChild(masker);\r\n\r\n if (!featureSupport.maskType && matteType === 1) {\r\n masker.setAttribute('mask-type', 'luminance');\r\n filId = createElementID();\r\n fil = filtersFactory.createFilter(filId);\r\n this.globalData.defs.appendChild(fil);\r\n fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());\r\n gg = createNS('g');\r\n gg.appendChild(useElement);\r\n masker.appendChild(gg);\r\n gg.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')');\r\n }\r\n } else if (matteType === 2) {\r\n var maskGroup = createNS('mask');\r\n maskGroup.setAttribute('id', id);\r\n maskGroup.setAttribute('mask-type', 'alpha');\r\n var maskGrouper = createNS('g');\r\n maskGroup.appendChild(maskGrouper);\r\n filId = createElementID();\r\n fil = filtersFactory.createFilter(filId); /// /\r\n\r\n var feCTr = createNS('feComponentTransfer');\r\n feCTr.setAttribute('in', 'SourceGraphic');\r\n fil.appendChild(feCTr);\r\n var feFunc = createNS('feFuncA');\r\n feFunc.setAttribute('type', 'table');\r\n feFunc.setAttribute('tableValues', '1.0 0.0');\r\n feCTr.appendChild(feFunc); /// /\r\n\r\n this.globalData.defs.appendChild(fil);\r\n var alphaRect = createNS('rect');\r\n alphaRect.setAttribute('width', this.comp.data.w);\r\n alphaRect.setAttribute('height', this.comp.data.h);\r\n alphaRect.setAttribute('x', '0');\r\n alphaRect.setAttribute('y', '0');\r\n alphaRect.setAttribute('fill', '#ffffff');\r\n alphaRect.setAttribute('opacity', '0');\r\n maskGrouper.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')');\r\n maskGrouper.appendChild(alphaRect);\r\n useElement = createNS('use');\r\n useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + this.layerId);\r\n maskGrouper.appendChild(useElement);\r\n\r\n if (!featureSupport.maskType) {\r\n maskGroup.setAttribute('mask-type', 'luminance');\r\n fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());\r\n gg = createNS('g');\r\n maskGrouper.appendChild(alphaRect);\r\n gg.appendChild(this.layerElement);\r\n maskGrouper.appendChild(gg);\r\n }\r\n\r\n this.globalData.defs.appendChild(maskGroup);\r\n }\r\n\r\n this.matteMasks[matteType] = id;\r\n }\r\n\r\n return this.matteMasks[matteType];\r\n },\r\n setMatte: function setMatte(id) {\r\n if (!this.matteElement) {\r\n return;\r\n }\r\n\r\n this.matteElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + id + ')');\r\n }\r\n };\r\n\r\n /**\r\n * @file\r\n * Handles AE's layer parenting property.\r\n *\r\n */\r\n function HierarchyElement() {}\r\n\r\n HierarchyElement.prototype = {\r\n /**\r\n * @function\r\n * Initializes hierarchy properties\r\n *\r\n */\r\n initHierarchy: function initHierarchy() {\r\n // element's parent list\r\n this.hierarchy = []; // if element is parent of another layer _isParent will be true\r\n\r\n this._isParent = false;\r\n this.checkParenting();\r\n },\r\n\r\n /**\r\n * @function\r\n * Sets layer's hierarchy.\r\n * @param {array} hierarch\r\n * layer's parent list\r\n *\r\n */\r\n setHierarchy: function setHierarchy(hierarchy) {\r\n this.hierarchy = hierarchy;\r\n },\r\n\r\n /**\r\n * @function\r\n * Sets layer as parent.\r\n *\r\n */\r\n setAsParent: function setAsParent() {\r\n this._isParent = true;\r\n },\r\n\r\n /**\r\n * @function\r\n * Searches layer's parenting chain\r\n *\r\n */\r\n checkParenting: function checkParenting() {\r\n if (this.data.parent !== undefined) {\r\n this.comp.buildElementParenting(this, this.data.parent, []);\r\n }\r\n }\r\n };\r\n\r\n function RenderableDOMElement() {}\r\n\r\n (function () {\r\n var _prototype = {\r\n initElement: function initElement(data, globalData, comp) {\r\n this.initFrame();\r\n this.initBaseData(data, globalData, comp);\r\n this.initTransform(data, globalData, comp);\r\n this.initHierarchy();\r\n this.initRenderable();\r\n this.initRendererElement();\r\n this.createContainerElements();\r\n this.createRenderableComponents();\r\n this.createContent();\r\n this.hide();\r\n },\r\n hide: function hide() {\r\n // console.log('HIDE', this);\r\n if (!this.hidden && (!this.isInRange || this.isTransparent)) {\r\n var elem = this.baseElement || this.layerElement;\r\n elem.style.display = 'none';\r\n this.hidden = true;\r\n }\r\n },\r\n show: function show() {\r\n // console.log('SHOW', this);\r\n if (this.isInRange && !this.isTransparent) {\r\n if (!this.data.hd) {\r\n var elem = this.baseElement || this.layerElement;\r\n elem.style.display = 'block';\r\n }\r\n\r\n this.hidden = false;\r\n this._isFirstFrame = true;\r\n }\r\n },\r\n renderFrame: function renderFrame() {\r\n // If it is exported as hidden (data.hd === true) no need to render\r\n // If it is not visible no need to render\r\n if (this.data.hd || this.hidden) {\r\n return;\r\n }\r\n\r\n this.renderTransform();\r\n this.renderRenderable();\r\n this.renderElement();\r\n this.renderInnerContent();\r\n\r\n if (this._isFirstFrame) {\r\n this._isFirstFrame = false;\r\n }\r\n },\r\n renderInnerContent: function renderInnerContent() {},\r\n prepareFrame: function prepareFrame(num) {\r\n this._mdf = false;\r\n this.prepareRenderableFrame(num);\r\n this.prepareProperties(num, this.isInRange);\r\n this.checkTransparency();\r\n },\r\n destroy: function destroy() {\r\n this.innerElem = null;\r\n this.destroyBaseElement();\r\n }\r\n };\r\n extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);\r\n })();\r\n\r\n function IImageElement(data, globalData, comp) {\r\n this.assetData = globalData.getAssetData(data.refId);\r\n this.initElement(data, globalData, comp);\r\n this.sourceRect = {\r\n top: 0,\r\n left: 0,\r\n width: this.assetData.w,\r\n height: this.assetData.h\r\n };\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);\r\n\r\n IImageElement.prototype.createContent = function () {\r\n var assetPath = this.globalData.getAssetsPath(this.assetData);\r\n this.innerElem = createNS('image');\r\n this.innerElem.setAttribute('width', this.assetData.w + 'px');\r\n this.innerElem.setAttribute('height', this.assetData.h + 'px');\r\n this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);\r\n this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);\r\n this.layerElement.appendChild(this.innerElem);\r\n };\r\n\r\n IImageElement.prototype.sourceRectAtTime = function () {\r\n return this.sourceRect;\r\n };\r\n\r\n function ProcessedElement(element, position) {\r\n this.elem = element;\r\n this.pos = position;\r\n }\r\n\r\n function IShapeElement() {}\r\n\r\n IShapeElement.prototype = {\r\n addShapeToModifiers: function addShapeToModifiers(data) {\r\n var i;\r\n var len = this.shapeModifiers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.shapeModifiers[i].addShape(data);\r\n }\r\n },\r\n isShapeInAnimatedModifiers: function isShapeInAnimatedModifiers(data) {\r\n var i = 0;\r\n var len = this.shapeModifiers.length;\r\n\r\n while (i < len) {\r\n if (this.shapeModifiers[i].isAnimatedWithShape(data)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n renderModifiers: function renderModifiers() {\r\n if (!this.shapeModifiers.length) {\r\n return;\r\n }\r\n\r\n var i;\r\n var len = this.shapes.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.shapes[i].sh.reset();\r\n }\r\n\r\n len = this.shapeModifiers.length;\r\n var shouldBreakProcess;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n shouldBreakProcess = this.shapeModifiers[i].processShapes(this._isFirstFrame); // workaround to fix cases where a repeater resets the shape so the following processes get called twice\r\n // TODO: find a better solution for this\r\n\r\n if (shouldBreakProcess) {\r\n break;\r\n }\r\n }\r\n },\r\n searchProcessedElement: function searchProcessedElement(elem) {\r\n var elements = this.processedElements;\r\n var i = 0;\r\n var len = elements.length;\r\n\r\n while (i < len) {\r\n if (elements[i].elem === elem) {\r\n return elements[i].pos;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return 0;\r\n },\r\n addProcessedElement: function addProcessedElement(elem, pos) {\r\n var elements = this.processedElements;\r\n var i = elements.length;\r\n\r\n while (i) {\r\n i -= 1;\r\n\r\n if (elements[i].elem === elem) {\r\n elements[i].pos = pos;\r\n return;\r\n }\r\n }\r\n\r\n elements.push(new ProcessedElement(elem, pos));\r\n },\r\n prepareFrame: function prepareFrame(num) {\r\n this.prepareRenderableFrame(num);\r\n this.prepareProperties(num, this.isInRange);\r\n }\r\n };\r\n\r\n var lineCapEnum = {\r\n 1: 'butt',\r\n 2: 'round',\r\n 3: 'square'\r\n };\r\n var lineJoinEnum = {\r\n 1: 'miter',\r\n 2: 'round',\r\n 3: 'bevel'\r\n };\r\n\r\n function SVGShapeData(transformers, level, shape) {\r\n this.caches = [];\r\n this.styles = [];\r\n this.transformers = transformers;\r\n this.lStr = '';\r\n this.sh = shape;\r\n this.lvl = level; // TODO find if there are some cases where _isAnimated can be false.\r\n // For now, since shapes add up with other shapes. They have to be calculated every time.\r\n // One way of finding out is checking if all styles associated to this shape depend only of this shape\r\n\r\n this._isAnimated = !!shape.k; // TODO: commenting this for now since all shapes are animated\r\n\r\n var i = 0;\r\n var len = transformers.length;\r\n\r\n while (i < len) {\r\n if (transformers[i].mProps.dynamicProperties.length) {\r\n this._isAnimated = true;\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n }\r\n\r\n SVGShapeData.prototype.setAsAnimated = function () {\r\n this._isAnimated = true;\r\n };\r\n\r\n function SVGStyleData(data, level) {\r\n this.data = data;\r\n this.type = data.ty;\r\n this.d = '';\r\n this.lvl = level;\r\n this._mdf = false;\r\n this.closed = data.hd === true;\r\n this.pElem = createNS('path');\r\n this.msElem = null;\r\n }\r\n\r\n SVGStyleData.prototype.reset = function () {\r\n this.d = '';\r\n this._mdf = false;\r\n };\r\n\r\n function DashProperty(elem, data, renderer, container) {\r\n this.elem = elem;\r\n this.frameId = -1;\r\n this.dataProps = createSizedArray(data.length);\r\n this.renderer = renderer;\r\n this.k = false;\r\n this.dashStr = '';\r\n this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);\r\n this.dashoffset = createTypedArray('float32', 1);\r\n this.initDynamicPropertyContainer(container);\r\n var i;\r\n var len = data.length || 0;\r\n var prop;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);\r\n this.k = prop.k || this.k;\r\n this.dataProps[i] = {\r\n n: data[i].n,\r\n p: prop\r\n };\r\n }\r\n\r\n if (!this.k) {\r\n this.getValue(true);\r\n }\r\n\r\n this._isAnimated = this.k;\r\n }\r\n\r\n DashProperty.prototype.getValue = function (forceRender) {\r\n if (this.elem.globalData.frameId === this.frameId && !forceRender) {\r\n return;\r\n }\r\n\r\n this.frameId = this.elem.globalData.frameId;\r\n this.iterateDynamicProperties();\r\n this._mdf = this._mdf || forceRender;\r\n\r\n if (this._mdf) {\r\n var i = 0;\r\n var len = this.dataProps.length;\r\n\r\n if (this.renderer === 'svg') {\r\n this.dashStr = '';\r\n }\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.dataProps[i].n !== 'o') {\r\n if (this.renderer === 'svg') {\r\n this.dashStr += ' ' + this.dataProps[i].p.v;\r\n } else {\r\n this.dashArray[i] = this.dataProps[i].p.v;\r\n }\r\n } else {\r\n this.dashoffset[0] = this.dataProps[i].p.v;\r\n }\r\n }\r\n }\r\n };\r\n\r\n extendPrototype([DynamicPropertyContainer], DashProperty);\r\n\r\n function SVGStrokeStyleData(elem, data, styleOb) {\r\n this.initDynamicPropertyContainer(elem);\r\n this.getValue = this.iterateDynamicProperties;\r\n this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);\r\n this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);\r\n this.d = new DashProperty(elem, data.d || {}, 'svg', this);\r\n this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);\r\n this.style = styleOb;\r\n this._isAnimated = !!this._isAnimated;\r\n }\r\n\r\n extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);\r\n\r\n function SVGFillStyleData(elem, data, styleOb) {\r\n this.initDynamicPropertyContainer(elem);\r\n this.getValue = this.iterateDynamicProperties;\r\n this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);\r\n this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);\r\n this.style = styleOb;\r\n }\r\n\r\n extendPrototype([DynamicPropertyContainer], SVGFillStyleData);\r\n\r\n function SVGNoStyleData(elem, data, styleOb) {\r\n this.initDynamicPropertyContainer(elem);\r\n this.getValue = this.iterateDynamicProperties;\r\n this.style = styleOb;\r\n }\r\n\r\n extendPrototype([DynamicPropertyContainer], SVGNoStyleData);\r\n\r\n function GradientProperty(elem, data, container) {\r\n this.data = data;\r\n this.c = createTypedArray('uint8c', data.p * 4);\r\n var cLength = data.k.k[0].s ? data.k.k[0].s.length - data.p * 4 : data.k.k.length - data.p * 4;\r\n this.o = createTypedArray('float32', cLength);\r\n this._cmdf = false;\r\n this._omdf = false;\r\n this._collapsable = this.checkCollapsable();\r\n this._hasOpacity = cLength;\r\n this.initDynamicPropertyContainer(container);\r\n this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);\r\n this.k = this.prop.k;\r\n this.getValue(true);\r\n }\r\n\r\n GradientProperty.prototype.comparePoints = function (values, points) {\r\n var i = 0;\r\n var len = this.o.length / 2;\r\n var diff;\r\n\r\n while (i < len) {\r\n diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);\r\n\r\n if (diff > 0.01) {\r\n return false;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n GradientProperty.prototype.checkCollapsable = function () {\r\n if (this.o.length / 2 !== this.c.length / 4) {\r\n return false;\r\n }\r\n\r\n if (this.data.k.k[0].s) {\r\n var i = 0;\r\n var len = this.data.k.k.length;\r\n\r\n while (i < len) {\r\n if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {\r\n return false;\r\n }\r\n\r\n i += 1;\r\n }\r\n } else if (!this.comparePoints(this.data.k.k, this.data.p)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n GradientProperty.prototype.getValue = function (forceRender) {\r\n this.prop.getValue();\r\n this._mdf = false;\r\n this._cmdf = false;\r\n this._omdf = false;\r\n\r\n if (this.prop._mdf || forceRender) {\r\n var i;\r\n var len = this.data.p * 4;\r\n var mult;\r\n var val;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n mult = i % 4 === 0 ? 100 : 255;\r\n val = Math.round(this.prop.v[i] * mult);\r\n\r\n if (this.c[i] !== val) {\r\n this.c[i] = val;\r\n this._cmdf = !forceRender;\r\n }\r\n }\r\n\r\n if (this.o.length) {\r\n len = this.prop.v.length;\r\n\r\n for (i = this.data.p * 4; i < len; i += 1) {\r\n mult = i % 2 === 0 ? 100 : 1;\r\n val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];\r\n\r\n if (this.o[i - this.data.p * 4] !== val) {\r\n this.o[i - this.data.p * 4] = val;\r\n this._omdf = !forceRender;\r\n }\r\n }\r\n }\r\n\r\n this._mdf = !forceRender;\r\n }\r\n };\r\n\r\n extendPrototype([DynamicPropertyContainer], GradientProperty);\r\n\r\n function SVGGradientFillStyleData(elem, data, styleOb) {\r\n this.initDynamicPropertyContainer(elem);\r\n this.getValue = this.iterateDynamicProperties;\r\n this.initGradientData(elem, data, styleOb);\r\n }\r\n\r\n SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {\r\n this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);\r\n this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);\r\n this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);\r\n this.h = PropertyFactory.getProp(elem, data.h || {\r\n k: 0\r\n }, 0, 0.01, this);\r\n this.a = PropertyFactory.getProp(elem, data.a || {\r\n k: 0\r\n }, 0, degToRads, this);\r\n this.g = new GradientProperty(elem, data.g, this);\r\n this.style = styleOb;\r\n this.stops = [];\r\n this.setGradientData(styleOb.pElem, data);\r\n this.setGradientOpacity(data, styleOb);\r\n this._isAnimated = !!this._isAnimated;\r\n };\r\n\r\n SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {\r\n var gradientId = createElementID();\r\n var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');\r\n gfill.setAttribute('id', gradientId);\r\n gfill.setAttribute('spreadMethod', 'pad');\r\n gfill.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n var stops = [];\r\n var stop;\r\n var j;\r\n var jLen;\r\n jLen = data.g.p * 4;\r\n\r\n for (j = 0; j < jLen; j += 4) {\r\n stop = createNS('stop');\r\n gfill.appendChild(stop);\r\n stops.push(stop);\r\n }\r\n\r\n pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + gradientId + ')');\r\n this.gf = gfill;\r\n this.cst = stops;\r\n };\r\n\r\n SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {\r\n if (this.g._hasOpacity && !this.g._collapsable) {\r\n var stop;\r\n var j;\r\n var jLen;\r\n var mask = createNS('mask');\r\n var maskElement = createNS('path');\r\n mask.appendChild(maskElement);\r\n var opacityId = createElementID();\r\n var maskId = createElementID();\r\n mask.setAttribute('id', maskId);\r\n var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');\r\n opFill.setAttribute('id', opacityId);\r\n opFill.setAttribute('spreadMethod', 'pad');\r\n opFill.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;\r\n var stops = this.stops;\r\n\r\n for (j = data.g.p * 4; j < jLen; j += 2) {\r\n stop = createNS('stop');\r\n stop.setAttribute('stop-color', 'rgb(255,255,255)');\r\n opFill.appendChild(stop);\r\n stops.push(stop);\r\n }\r\n\r\n maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + opacityId + ')');\r\n\r\n if (data.ty === 'gs') {\r\n maskElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]);\r\n maskElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]);\r\n\r\n if (data.lj === 1) {\r\n maskElement.setAttribute('stroke-miterlimit', data.ml);\r\n }\r\n }\r\n\r\n this.of = opFill;\r\n this.ms = mask;\r\n this.ost = stops;\r\n this.maskId = maskId;\r\n styleOb.msElem = maskElement;\r\n }\r\n };\r\n\r\n extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);\r\n\r\n function SVGGradientStrokeStyleData(elem, data, styleOb) {\r\n this.initDynamicPropertyContainer(elem);\r\n this.getValue = this.iterateDynamicProperties;\r\n this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);\r\n this.d = new DashProperty(elem, data.d || {}, 'svg', this);\r\n this.initGradientData(elem, data, styleOb);\r\n this._isAnimated = !!this._isAnimated;\r\n }\r\n\r\n extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);\r\n\r\n function ShapeGroupData() {\r\n this.it = [];\r\n this.prevViewData = [];\r\n this.gr = createNS('g');\r\n }\r\n\r\n function SVGTransformData(mProps, op, container) {\r\n this.transform = {\r\n mProps: mProps,\r\n op: op,\r\n container: container\r\n };\r\n this.elements = [];\r\n this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;\r\n }\r\n\r\n var buildShapeString = function buildShapeString(pathNodes, length, closed, mat) {\r\n if (length === 0) {\r\n return '';\r\n }\r\n\r\n var _o = pathNodes.o;\r\n var _i = pathNodes.i;\r\n var _v = pathNodes.v;\r\n var i;\r\n var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);\r\n\r\n for (i = 1; i < length; i += 1) {\r\n shapeString += ' C' + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + ' ' + mat.applyToPointStringified(_i[i][0], _i[i][1]) + ' ' + mat.applyToPointStringified(_v[i][0], _v[i][1]);\r\n }\r\n\r\n if (closed && length) {\r\n shapeString += ' C' + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + ' ' + mat.applyToPointStringified(_i[0][0], _i[0][1]) + ' ' + mat.applyToPointStringified(_v[0][0], _v[0][1]);\r\n shapeString += 'z';\r\n }\r\n\r\n return shapeString;\r\n };\r\n\r\n var SVGElementsRenderer = function () {\r\n var _identityMatrix = new Matrix();\r\n\r\n var _matrixHelper = new Matrix();\r\n\r\n var ob = {\r\n createRenderFunction: createRenderFunction\r\n };\r\n\r\n function createRenderFunction(data) {\r\n switch (data.ty) {\r\n case 'fl':\r\n return renderFill;\r\n\r\n case 'gf':\r\n return renderGradient;\r\n\r\n case 'gs':\r\n return renderGradientStroke;\r\n\r\n case 'st':\r\n return renderStroke;\r\n\r\n case 'sh':\r\n case 'el':\r\n case 'rc':\r\n case 'sr':\r\n return renderPath;\r\n\r\n case 'tr':\r\n return renderContentTransform;\r\n\r\n case 'no':\r\n return renderNoop;\r\n\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n function renderContentTransform(styleData, itemData, isFirstFrame) {\r\n if (isFirstFrame || itemData.transform.op._mdf) {\r\n itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);\r\n }\r\n\r\n if (isFirstFrame || itemData.transform.mProps._mdf) {\r\n itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());\r\n }\r\n }\r\n\r\n function renderNoop() {}\r\n\r\n function renderPath(styleData, itemData, isFirstFrame) {\r\n var j;\r\n var jLen;\r\n var pathStringTransformed;\r\n var redraw;\r\n var pathNodes;\r\n var l;\r\n var lLen = itemData.styles.length;\r\n var lvl = itemData.lvl;\r\n var paths;\r\n var mat;\r\n var props;\r\n var iterations;\r\n var k;\r\n\r\n for (l = 0; l < lLen; l += 1) {\r\n redraw = itemData.sh._mdf || isFirstFrame;\r\n\r\n if (itemData.styles[l].lvl < lvl) {\r\n mat = _matrixHelper.reset();\r\n iterations = lvl - itemData.styles[l].lvl;\r\n k = itemData.transformers.length - 1;\r\n\r\n while (!redraw && iterations > 0) {\r\n redraw = itemData.transformers[k].mProps._mdf || redraw;\r\n iterations -= 1;\r\n k -= 1;\r\n }\r\n\r\n if (redraw) {\r\n iterations = lvl - itemData.styles[l].lvl;\r\n k = itemData.transformers.length - 1;\r\n\r\n while (iterations > 0) {\r\n props = itemData.transformers[k].mProps.v.props;\r\n mat.transform(props[0], props[1], props[2], props[3], props[4], props[5], props[6], props[7], props[8], props[9], props[10], props[11], props[12], props[13], props[14], props[15]);\r\n iterations -= 1;\r\n k -= 1;\r\n }\r\n }\r\n } else {\r\n mat = _identityMatrix;\r\n }\r\n\r\n paths = itemData.sh.paths;\r\n jLen = paths._length;\r\n\r\n if (redraw) {\r\n pathStringTransformed = '';\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n pathNodes = paths.shapes[j];\r\n\r\n if (pathNodes && pathNodes._length) {\r\n pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);\r\n }\r\n }\r\n\r\n itemData.caches[l] = pathStringTransformed;\r\n } else {\r\n pathStringTransformed = itemData.caches[l];\r\n }\r\n\r\n itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;\r\n itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;\r\n }\r\n }\r\n\r\n function renderFill(styleData, itemData, isFirstFrame) {\r\n var styleElem = itemData.style;\r\n\r\n if (itemData.c._mdf || isFirstFrame) {\r\n styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');\r\n }\r\n\r\n if (itemData.o._mdf || isFirstFrame) {\r\n styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);\r\n }\r\n }\r\n\r\n function renderGradientStroke(styleData, itemData, isFirstFrame) {\r\n renderGradient(styleData, itemData, isFirstFrame);\r\n renderStroke(styleData, itemData, isFirstFrame);\r\n }\r\n\r\n function renderGradient(styleData, itemData, isFirstFrame) {\r\n var gfill = itemData.gf;\r\n var hasOpacity = itemData.g._hasOpacity;\r\n var pt1 = itemData.s.v;\r\n var pt2 = itemData.e.v;\r\n\r\n if (itemData.o._mdf || isFirstFrame) {\r\n var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';\r\n itemData.style.pElem.setAttribute(attr, itemData.o.v);\r\n }\r\n\r\n if (itemData.s._mdf || isFirstFrame) {\r\n var attr1 = styleData.t === 1 ? 'x1' : 'cx';\r\n var attr2 = attr1 === 'x1' ? 'y1' : 'cy';\r\n gfill.setAttribute(attr1, pt1[0]);\r\n gfill.setAttribute(attr2, pt1[1]);\r\n\r\n if (hasOpacity && !itemData.g._collapsable) {\r\n itemData.of.setAttribute(attr1, pt1[0]);\r\n itemData.of.setAttribute(attr2, pt1[1]);\r\n }\r\n }\r\n\r\n var stops;\r\n var i;\r\n var len;\r\n var stop;\r\n\r\n if (itemData.g._cmdf || isFirstFrame) {\r\n stops = itemData.cst;\r\n var cValues = itemData.g.c;\r\n len = stops.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n stop = stops[i];\r\n stop.setAttribute('offset', cValues[i * 4] + '%');\r\n stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');\r\n }\r\n }\r\n\r\n if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {\r\n var oValues = itemData.g.o;\r\n\r\n if (itemData.g._collapsable) {\r\n stops = itemData.cst;\r\n } else {\r\n stops = itemData.ost;\r\n }\r\n\r\n len = stops.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n stop = stops[i];\r\n\r\n if (!itemData.g._collapsable) {\r\n stop.setAttribute('offset', oValues[i * 2] + '%');\r\n }\r\n\r\n stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);\r\n }\r\n }\r\n\r\n if (styleData.t === 1) {\r\n if (itemData.e._mdf || isFirstFrame) {\r\n gfill.setAttribute('x2', pt2[0]);\r\n gfill.setAttribute('y2', pt2[1]);\r\n\r\n if (hasOpacity && !itemData.g._collapsable) {\r\n itemData.of.setAttribute('x2', pt2[0]);\r\n itemData.of.setAttribute('y2', pt2[1]);\r\n }\r\n }\r\n } else {\r\n var rad;\r\n\r\n if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {\r\n rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));\r\n gfill.setAttribute('r', rad);\r\n\r\n if (hasOpacity && !itemData.g._collapsable) {\r\n itemData.of.setAttribute('r', rad);\r\n }\r\n }\r\n\r\n if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {\r\n if (!rad) {\r\n rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));\r\n }\r\n\r\n var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);\r\n var percent = itemData.h.v;\r\n\r\n if (percent >= 1) {\r\n percent = 0.99;\r\n } else if (percent <= -1) {\r\n percent = -0.99;\r\n }\r\n\r\n var dist = rad * percent;\r\n var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];\r\n var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];\r\n gfill.setAttribute('fx', x);\r\n gfill.setAttribute('fy', y);\r\n\r\n if (hasOpacity && !itemData.g._collapsable) {\r\n itemData.of.setAttribute('fx', x);\r\n itemData.of.setAttribute('fy', y);\r\n }\r\n } // gfill.setAttribute('fy','200');\r\n\r\n }\r\n }\r\n\r\n function renderStroke(styleData, itemData, isFirstFrame) {\r\n var styleElem = itemData.style;\r\n var d = itemData.d;\r\n\r\n if (d && (d._mdf || isFirstFrame) && d.dashStr) {\r\n styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);\r\n styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);\r\n }\r\n\r\n if (itemData.c && (itemData.c._mdf || isFirstFrame)) {\r\n styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');\r\n }\r\n\r\n if (itemData.o._mdf || isFirstFrame) {\r\n styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);\r\n }\r\n\r\n if (itemData.w._mdf || isFirstFrame) {\r\n styleElem.pElem.setAttribute('stroke-width', itemData.w.v);\r\n\r\n if (styleElem.msElem) {\r\n styleElem.msElem.setAttribute('stroke-width', itemData.w.v);\r\n }\r\n }\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n function SVGShapeElement(data, globalData, comp) {\r\n // List of drawable elements\r\n this.shapes = []; // Full shape data\r\n\r\n this.shapesData = data.shapes; // List of styles that will be applied to shapes\r\n\r\n this.stylesList = []; // List of modifiers that will be applied to shapes\r\n\r\n this.shapeModifiers = []; // List of items in shape tree\r\n\r\n this.itemsData = []; // List of items in previous shape tree\r\n\r\n this.processedElements = []; // List of animated components\r\n\r\n this.animatedContents = [];\r\n this.initElement(data, globalData, comp); // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.\r\n // List of elements that have been created\r\n\r\n this.prevViewData = []; // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);\r\n\r\n SVGShapeElement.prototype.initSecondaryElement = function () {};\r\n\r\n SVGShapeElement.prototype.identityMatrix = new Matrix();\r\n\r\n SVGShapeElement.prototype.buildExpressionInterface = function () {};\r\n\r\n SVGShapeElement.prototype.createContent = function () {\r\n this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);\r\n this.filterUniqueShapes();\r\n };\r\n /*\r\n This method searches for multiple shapes that affect a single element and one of them is animated\r\n */\r\n\r\n\r\n SVGShapeElement.prototype.filterUniqueShapes = function () {\r\n var i;\r\n var len = this.shapes.length;\r\n var shape;\r\n var j;\r\n var jLen = this.stylesList.length;\r\n var style;\r\n var tempShapes = [];\r\n var areAnimated = false;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n style = this.stylesList[j];\r\n areAnimated = false;\r\n tempShapes.length = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shape = this.shapes[i];\r\n\r\n if (shape.styles.indexOf(style) !== -1) {\r\n tempShapes.push(shape);\r\n areAnimated = shape._isAnimated || areAnimated;\r\n }\r\n }\r\n\r\n if (tempShapes.length > 1 && areAnimated) {\r\n this.setShapesAsAnimated(tempShapes);\r\n }\r\n }\r\n };\r\n\r\n SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {\r\n var i;\r\n var len = shapes.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n shapes[i].setAsAnimated();\r\n }\r\n };\r\n\r\n SVGShapeElement.prototype.createStyleElement = function (data, level) {\r\n // TODO: prevent drawing of hidden styles\r\n var elementData;\r\n var styleOb = new SVGStyleData(data, level);\r\n var pathElement = styleOb.pElem;\r\n\r\n if (data.ty === 'st') {\r\n elementData = new SVGStrokeStyleData(this, data, styleOb);\r\n } else if (data.ty === 'fl') {\r\n elementData = new SVGFillStyleData(this, data, styleOb);\r\n } else if (data.ty === 'gf' || data.ty === 'gs') {\r\n var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;\r\n elementData = new GradientConstructor(this, data, styleOb);\r\n this.globalData.defs.appendChild(elementData.gf);\r\n\r\n if (elementData.maskId) {\r\n this.globalData.defs.appendChild(elementData.ms);\r\n this.globalData.defs.appendChild(elementData.of);\r\n pathElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + elementData.maskId + ')');\r\n }\r\n } else if (data.ty === 'no') {\r\n elementData = new SVGNoStyleData(this, data, styleOb);\r\n }\r\n\r\n if (data.ty === 'st' || data.ty === 'gs') {\r\n pathElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]);\r\n pathElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]);\r\n pathElement.setAttribute('fill-opacity', '0');\r\n\r\n if (data.lj === 1) {\r\n pathElement.setAttribute('stroke-miterlimit', data.ml);\r\n }\r\n }\r\n\r\n if (data.r === 2) {\r\n pathElement.setAttribute('fill-rule', 'evenodd');\r\n }\r\n\r\n if (data.ln) {\r\n pathElement.setAttribute('id', data.ln);\r\n }\r\n\r\n if (data.cl) {\r\n pathElement.setAttribute('class', data.cl);\r\n }\r\n\r\n if (data.bm) {\r\n pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);\r\n }\r\n\r\n this.stylesList.push(styleOb);\r\n this.addToAnimatedContents(data, elementData);\r\n return elementData;\r\n };\r\n\r\n SVGShapeElement.prototype.createGroupElement = function (data) {\r\n var elementData = new ShapeGroupData();\r\n\r\n if (data.ln) {\r\n elementData.gr.setAttribute('id', data.ln);\r\n }\r\n\r\n if (data.cl) {\r\n elementData.gr.setAttribute('class', data.cl);\r\n }\r\n\r\n if (data.bm) {\r\n elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);\r\n }\r\n\r\n return elementData;\r\n };\r\n\r\n SVGShapeElement.prototype.createTransformElement = function (data, container) {\r\n var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);\r\n var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);\r\n this.addToAnimatedContents(data, elementData);\r\n return elementData;\r\n };\r\n\r\n SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {\r\n var ty = 4;\r\n\r\n if (data.ty === 'rc') {\r\n ty = 5;\r\n } else if (data.ty === 'el') {\r\n ty = 6;\r\n } else if (data.ty === 'sr') {\r\n ty = 7;\r\n }\r\n\r\n var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);\r\n var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);\r\n this.shapes.push(elementData);\r\n this.addShapeToModifiers(elementData);\r\n this.addToAnimatedContents(data, elementData);\r\n return elementData;\r\n };\r\n\r\n SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {\r\n var i = 0;\r\n var len = this.animatedContents.length;\r\n\r\n while (i < len) {\r\n if (this.animatedContents[i].element === element) {\r\n return;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n this.animatedContents.push({\r\n fn: SVGElementsRenderer.createRenderFunction(data),\r\n element: element,\r\n data: data\r\n });\r\n };\r\n\r\n SVGShapeElement.prototype.setElementStyles = function (elementData) {\r\n var arr = elementData.styles;\r\n var j;\r\n var jLen = this.stylesList.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (!this.stylesList[j].closed) {\r\n arr.push(this.stylesList[j]);\r\n }\r\n }\r\n };\r\n\r\n SVGShapeElement.prototype.reloadShapes = function () {\r\n this._isFirstFrame = true;\r\n var i;\r\n var len = this.itemsData.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.prevViewData[i] = this.itemsData[i];\r\n }\r\n\r\n this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);\r\n this.filterUniqueShapes();\r\n len = this.dynamicProperties.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.dynamicProperties[i].getValue();\r\n }\r\n\r\n this.renderModifiers();\r\n };\r\n\r\n SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {\r\n var ownTransformers = [].concat(transformers);\r\n var i;\r\n var len = arr.length - 1;\r\n var j;\r\n var jLen;\r\n var ownStyles = [];\r\n var ownModifiers = [];\r\n var currentTransform;\r\n var modifier;\r\n var processedPos;\r\n\r\n for (i = len; i >= 0; i -= 1) {\r\n processedPos = this.searchProcessedElement(arr[i]);\r\n\r\n if (!processedPos) {\r\n arr[i]._render = render;\r\n } else {\r\n itemsData[i] = prevViewData[processedPos - 1];\r\n }\r\n\r\n if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs' || arr[i].ty === 'no') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createStyleElement(arr[i], level);\r\n } else {\r\n itemsData[i].style.closed = false;\r\n }\r\n\r\n if (arr[i]._render) {\r\n if (itemsData[i].style.pElem.parentNode !== container) {\r\n container.appendChild(itemsData[i].style.pElem);\r\n }\r\n }\r\n\r\n ownStyles.push(itemsData[i].style);\r\n } else if (arr[i].ty === 'gr') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createGroupElement(arr[i]);\r\n } else {\r\n jLen = itemsData[i].it.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n itemsData[i].prevViewData[j] = itemsData[i].it[j];\r\n }\r\n }\r\n\r\n this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);\r\n\r\n if (arr[i]._render) {\r\n if (itemsData[i].gr.parentNode !== container) {\r\n container.appendChild(itemsData[i].gr);\r\n }\r\n }\r\n } else if (arr[i].ty === 'tr') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createTransformElement(arr[i], container);\r\n }\r\n\r\n currentTransform = itemsData[i].transform;\r\n ownTransformers.push(currentTransform);\r\n } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);\r\n }\r\n\r\n this.setElementStyles(itemsData[i]);\r\n } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') {\r\n if (!processedPos) {\r\n modifier = ShapeModifiers.getModifier(arr[i].ty);\r\n modifier.init(this, arr[i]);\r\n itemsData[i] = modifier;\r\n this.shapeModifiers.push(modifier);\r\n } else {\r\n modifier = itemsData[i];\r\n modifier.closed = false;\r\n }\r\n\r\n ownModifiers.push(modifier);\r\n } else if (arr[i].ty === 'rp') {\r\n if (!processedPos) {\r\n modifier = ShapeModifiers.getModifier(arr[i].ty);\r\n itemsData[i] = modifier;\r\n modifier.init(this, arr, i, itemsData);\r\n this.shapeModifiers.push(modifier);\r\n render = false;\r\n } else {\r\n modifier = itemsData[i];\r\n modifier.closed = true;\r\n }\r\n\r\n ownModifiers.push(modifier);\r\n }\r\n\r\n this.addProcessedElement(arr[i], i + 1);\r\n }\r\n\r\n len = ownStyles.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ownStyles[i].closed = true;\r\n }\r\n\r\n len = ownModifiers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ownModifiers[i].closed = true;\r\n }\r\n };\r\n\r\n SVGShapeElement.prototype.renderInnerContent = function () {\r\n this.renderModifiers();\r\n var i;\r\n var len = this.stylesList.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.stylesList[i].reset();\r\n }\r\n\r\n this.renderShape();\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.stylesList[i]._mdf || this._isFirstFrame) {\r\n if (this.stylesList[i].msElem) {\r\n this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d); // Adding M0 0 fixes same mask bug on all browsers\r\n\r\n this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;\r\n }\r\n\r\n this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');\r\n }\r\n }\r\n };\r\n\r\n SVGShapeElement.prototype.renderShape = function () {\r\n var i;\r\n var len = this.animatedContents.length;\r\n var animatedContent;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n animatedContent = this.animatedContents[i];\r\n\r\n if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {\r\n animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);\r\n }\r\n }\r\n };\r\n\r\n SVGShapeElement.prototype.destroy = function () {\r\n this.destroyBaseElement();\r\n this.shapesData = null;\r\n this.itemsData = null;\r\n };\r\n\r\n function LetterProps(o, sw, sc, fc, m, p) {\r\n this.o = o;\r\n this.sw = sw;\r\n this.sc = sc;\r\n this.fc = fc;\r\n this.m = m;\r\n this.p = p;\r\n this._mdf = {\r\n o: true,\r\n sw: !!sw,\r\n sc: !!sc,\r\n fc: !!fc,\r\n m: true,\r\n p: true\r\n };\r\n }\r\n\r\n LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {\r\n this._mdf.o = false;\r\n this._mdf.sw = false;\r\n this._mdf.sc = false;\r\n this._mdf.fc = false;\r\n this._mdf.m = false;\r\n this._mdf.p = false;\r\n var updated = false;\r\n\r\n if (this.o !== o) {\r\n this.o = o;\r\n this._mdf.o = true;\r\n updated = true;\r\n }\r\n\r\n if (this.sw !== sw) {\r\n this.sw = sw;\r\n this._mdf.sw = true;\r\n updated = true;\r\n }\r\n\r\n if (this.sc !== sc) {\r\n this.sc = sc;\r\n this._mdf.sc = true;\r\n updated = true;\r\n }\r\n\r\n if (this.fc !== fc) {\r\n this.fc = fc;\r\n this._mdf.fc = true;\r\n updated = true;\r\n }\r\n\r\n if (this.m !== m) {\r\n this.m = m;\r\n this._mdf.m = true;\r\n updated = true;\r\n }\r\n\r\n if (p.length && (this.p[0] !== p[0] || this.p[1] !== p[1] || this.p[4] !== p[4] || this.p[5] !== p[5] || this.p[12] !== p[12] || this.p[13] !== p[13])) {\r\n this.p = p;\r\n this._mdf.p = true;\r\n updated = true;\r\n }\r\n\r\n return updated;\r\n };\r\n\r\n function TextProperty(elem, data) {\r\n this._frameId = initialDefaultFrame;\r\n this.pv = '';\r\n this.v = '';\r\n this.kf = false;\r\n this._isFirstFrame = true;\r\n this._mdf = false;\r\n this.data = data;\r\n this.elem = elem;\r\n this.comp = this.elem.comp;\r\n this.keysIndex = 0;\r\n this.canResize = false;\r\n this.minimumFontSize = 1;\r\n this.effectsSequence = [];\r\n this.currentData = {\r\n ascent: 0,\r\n boxWidth: this.defaultBoxWidth,\r\n f: '',\r\n fStyle: '',\r\n fWeight: '',\r\n fc: '',\r\n j: '',\r\n justifyOffset: '',\r\n l: [],\r\n lh: 0,\r\n lineWidths: [],\r\n ls: '',\r\n of: '',\r\n s: '',\r\n sc: '',\r\n sw: 0,\r\n t: 0,\r\n tr: 0,\r\n sz: 0,\r\n ps: null,\r\n fillColorAnim: false,\r\n strokeColorAnim: false,\r\n strokeWidthAnim: false,\r\n yOffset: 0,\r\n finalSize: 0,\r\n finalText: [],\r\n finalLineHeight: 0,\r\n __complete: false\r\n };\r\n this.copyData(this.currentData, this.data.d.k[0].s);\r\n\r\n if (!this.searchProperty()) {\r\n this.completeTextData(this.currentData);\r\n }\r\n }\r\n\r\n TextProperty.prototype.defaultBoxWidth = [0, 0];\r\n\r\n TextProperty.prototype.copyData = function (obj, data) {\r\n for (var s in data) {\r\n if (Object.prototype.hasOwnProperty.call(data, s)) {\r\n obj[s] = data[s];\r\n }\r\n }\r\n\r\n return obj;\r\n };\r\n\r\n TextProperty.prototype.setCurrentData = function (data) {\r\n if (!data.__complete) {\r\n this.completeTextData(data);\r\n }\r\n\r\n this.currentData = data;\r\n this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;\r\n this._mdf = true;\r\n };\r\n\r\n TextProperty.prototype.searchProperty = function () {\r\n return this.searchKeyframes();\r\n };\r\n\r\n TextProperty.prototype.searchKeyframes = function () {\r\n this.kf = this.data.d.k.length > 1;\r\n\r\n if (this.kf) {\r\n this.addEffect(this.getKeyframeValue.bind(this));\r\n }\r\n\r\n return this.kf;\r\n };\r\n\r\n TextProperty.prototype.addEffect = function (effectFunction) {\r\n this.effectsSequence.push(effectFunction);\r\n this.elem.addDynamicProperty(this);\r\n };\r\n\r\n TextProperty.prototype.getValue = function (_finalValue) {\r\n if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {\r\n return;\r\n }\r\n\r\n this.currentData.t = this.data.d.k[this.keysIndex].s.t;\r\n var currentValue = this.currentData;\r\n var currentIndex = this.keysIndex;\r\n\r\n if (this.lock) {\r\n this.setCurrentData(this.currentData);\r\n return;\r\n }\r\n\r\n this.lock = true;\r\n this._mdf = false;\r\n var i;\r\n var len = this.effectsSequence.length;\r\n var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n // Checking if index changed to prevent creating a new object every time the expression updates.\r\n if (currentIndex !== this.keysIndex) {\r\n finalValue = this.effectsSequence[i](finalValue, finalValue.t);\r\n } else {\r\n finalValue = this.effectsSequence[i](this.currentData, finalValue.t);\r\n }\r\n }\r\n\r\n if (currentValue !== finalValue) {\r\n this.setCurrentData(finalValue);\r\n }\r\n\r\n this.v = this.currentData;\r\n this.pv = this.v;\r\n this.lock = false;\r\n this.frameId = this.elem.globalData.frameId;\r\n };\r\n\r\n TextProperty.prototype.getKeyframeValue = function () {\r\n var textKeys = this.data.d.k;\r\n var frameNum = this.elem.comp.renderedFrame;\r\n var i = 0;\r\n var len = textKeys.length;\r\n\r\n while (i <= len - 1) {\r\n if (i === len - 1 || textKeys[i + 1].t > frameNum) {\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (this.keysIndex !== i) {\r\n this.keysIndex = i;\r\n }\r\n\r\n return this.data.d.k[this.keysIndex].s;\r\n };\r\n\r\n TextProperty.prototype.buildFinalText = function (text) {\r\n var charactersArray = [];\r\n var i = 0;\r\n var len = text.length;\r\n var charCode;\r\n var secondCharCode;\r\n var shouldCombine = false;\r\n\r\n while (i < len) {\r\n charCode = text.charCodeAt(i);\r\n\r\n if (FontManager.isCombinedCharacter(charCode)) {\r\n charactersArray[charactersArray.length - 1] += text.charAt(i);\r\n } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {\r\n secondCharCode = text.charCodeAt(i + 1);\r\n\r\n if (secondCharCode >= 0xDC00 && secondCharCode <= 0xDFFF) {\r\n if (shouldCombine || FontManager.isModifier(charCode, secondCharCode)) {\r\n charactersArray[charactersArray.length - 1] += text.substr(i, 2);\r\n shouldCombine = false;\r\n } else {\r\n charactersArray.push(text.substr(i, 2));\r\n }\r\n\r\n i += 1;\r\n } else {\r\n charactersArray.push(text.charAt(i));\r\n }\r\n } else if (charCode > 0xDBFF) {\r\n secondCharCode = text.charCodeAt(i + 1);\r\n\r\n if (FontManager.isZeroWidthJoiner(charCode, secondCharCode)) {\r\n shouldCombine = true;\r\n charactersArray[charactersArray.length - 1] += text.substr(i, 2);\r\n i += 1;\r\n } else {\r\n charactersArray.push(text.charAt(i));\r\n }\r\n } else if (FontManager.isZeroWidthJoiner(charCode)) {\r\n charactersArray[charactersArray.length - 1] += text.charAt(i);\r\n shouldCombine = true;\r\n } else {\r\n charactersArray.push(text.charAt(i));\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return charactersArray;\r\n };\r\n\r\n TextProperty.prototype.completeTextData = function (documentData) {\r\n documentData.__complete = true;\r\n var fontManager = this.elem.globalData.fontManager;\r\n var data = this.data;\r\n var letters = [];\r\n var i;\r\n var len;\r\n var newLineFlag;\r\n var index = 0;\r\n var val;\r\n var anchorGrouping = data.m.g;\r\n var currentSize = 0;\r\n var currentPos = 0;\r\n var currentLine = 0;\r\n var lineWidths = [];\r\n var lineWidth = 0;\r\n var maxLineWidth = 0;\r\n var j;\r\n var jLen;\r\n var fontData = fontManager.getFontByName(documentData.f);\r\n var charData;\r\n var cLength = 0;\r\n var fontProps = getFontProperties(fontData);\r\n documentData.fWeight = fontProps.weight;\r\n documentData.fStyle = fontProps.style;\r\n documentData.finalSize = documentData.s;\r\n documentData.finalText = this.buildFinalText(documentData.t);\r\n len = documentData.finalText.length;\r\n documentData.finalLineHeight = documentData.lh;\r\n var trackingOffset = documentData.tr / 1000 * documentData.finalSize;\r\n var charCode;\r\n\r\n if (documentData.sz) {\r\n var flag = true;\r\n var boxWidth = documentData.sz[0];\r\n var boxHeight = documentData.sz[1];\r\n var currentHeight;\r\n var finalText;\r\n\r\n while (flag) {\r\n finalText = this.buildFinalText(documentData.t);\r\n currentHeight = 0;\r\n lineWidth = 0;\r\n len = finalText.length;\r\n trackingOffset = documentData.tr / 1000 * documentData.finalSize;\r\n var lastSpaceIndex = -1;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n charCode = finalText[i].charCodeAt(0);\r\n newLineFlag = false;\r\n\r\n if (finalText[i] === ' ') {\r\n lastSpaceIndex = i;\r\n } else if (charCode === 13 || charCode === 3) {\r\n lineWidth = 0;\r\n newLineFlag = true;\r\n currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;\r\n }\r\n\r\n if (fontManager.chars) {\r\n charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);\r\n cLength = newLineFlag ? 0 : charData.w * documentData.finalSize / 100;\r\n } else {\r\n // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;\r\n cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);\r\n }\r\n\r\n if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {\r\n if (lastSpaceIndex === -1) {\r\n len += 1;\r\n } else {\r\n i = lastSpaceIndex;\r\n }\r\n\r\n currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;\r\n finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\\r'); // finalText = finalText.substr(0,i) + \"\\r\" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);\r\n\r\n lastSpaceIndex = -1;\r\n lineWidth = 0;\r\n } else {\r\n lineWidth += cLength;\r\n lineWidth += trackingOffset;\r\n }\r\n }\r\n\r\n currentHeight += fontData.ascent * documentData.finalSize / 100;\r\n\r\n if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {\r\n documentData.finalSize -= 1;\r\n documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;\r\n } else {\r\n documentData.finalText = finalText;\r\n len = documentData.finalText.length;\r\n flag = false;\r\n }\r\n }\r\n }\r\n\r\n lineWidth = -trackingOffset;\r\n cLength = 0;\r\n var uncollapsedSpaces = 0;\r\n var currentChar;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n newLineFlag = false;\r\n currentChar = documentData.finalText[i];\r\n charCode = currentChar.charCodeAt(0);\r\n\r\n if (charCode === 13 || charCode === 3) {\r\n uncollapsedSpaces = 0;\r\n lineWidths.push(lineWidth);\r\n maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;\r\n lineWidth = -2 * trackingOffset;\r\n val = '';\r\n newLineFlag = true;\r\n currentLine += 1;\r\n } else {\r\n val = currentChar;\r\n }\r\n\r\n if (fontManager.chars) {\r\n charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);\r\n cLength = newLineFlag ? 0 : charData.w * documentData.finalSize / 100;\r\n } else {\r\n // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);\r\n // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;\r\n cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);\r\n } //\r\n\r\n\r\n if (currentChar === ' ') {\r\n uncollapsedSpaces += cLength + trackingOffset;\r\n } else {\r\n lineWidth += cLength + trackingOffset + uncollapsedSpaces;\r\n uncollapsedSpaces = 0;\r\n }\r\n\r\n letters.push({\r\n l: cLength,\r\n an: cLength,\r\n add: currentSize,\r\n n: newLineFlag,\r\n anIndexes: [],\r\n val: val,\r\n line: currentLine,\r\n animatorJustifyOffset: 0\r\n });\r\n\r\n if (anchorGrouping == 2) {\r\n // eslint-disable-line eqeqeq\r\n currentSize += cLength;\r\n\r\n if (val === '' || val === ' ' || i === len - 1) {\r\n if (val === '' || val === ' ') {\r\n currentSize -= cLength;\r\n }\r\n\r\n while (currentPos <= i) {\r\n letters[currentPos].an = currentSize;\r\n letters[currentPos].ind = index;\r\n letters[currentPos].extra = cLength;\r\n currentPos += 1;\r\n }\r\n\r\n index += 1;\r\n currentSize = 0;\r\n }\r\n } else if (anchorGrouping == 3) {\r\n // eslint-disable-line eqeqeq\r\n currentSize += cLength;\r\n\r\n if (val === '' || i === len - 1) {\r\n if (val === '') {\r\n currentSize -= cLength;\r\n }\r\n\r\n while (currentPos <= i) {\r\n letters[currentPos].an = currentSize;\r\n letters[currentPos].ind = index;\r\n letters[currentPos].extra = cLength;\r\n currentPos += 1;\r\n }\r\n\r\n currentSize = 0;\r\n index += 1;\r\n }\r\n } else {\r\n letters[index].ind = index;\r\n letters[index].extra = 0;\r\n index += 1;\r\n }\r\n }\r\n\r\n documentData.l = letters;\r\n maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;\r\n lineWidths.push(lineWidth);\r\n\r\n if (documentData.sz) {\r\n documentData.boxWidth = documentData.sz[0];\r\n documentData.justifyOffset = 0;\r\n } else {\r\n documentData.boxWidth = maxLineWidth;\r\n\r\n switch (documentData.j) {\r\n case 1:\r\n documentData.justifyOffset = -documentData.boxWidth;\r\n break;\r\n\r\n case 2:\r\n documentData.justifyOffset = -documentData.boxWidth / 2;\r\n break;\r\n\r\n default:\r\n documentData.justifyOffset = 0;\r\n }\r\n }\r\n\r\n documentData.lineWidths = lineWidths;\r\n var animators = data.a;\r\n var animatorData;\r\n var letterData;\r\n jLen = animators.length;\r\n var based;\r\n var ind;\r\n var indexes = [];\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorData = animators[j];\r\n\r\n if (animatorData.a.sc) {\r\n documentData.strokeColorAnim = true;\r\n }\r\n\r\n if (animatorData.a.sw) {\r\n documentData.strokeWidthAnim = true;\r\n }\r\n\r\n if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {\r\n documentData.fillColorAnim = true;\r\n }\r\n\r\n ind = 0;\r\n based = animatorData.s.b;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n letterData = letters[i];\r\n letterData.anIndexes[j] = ind;\r\n\r\n if (based == 1 && letterData.val !== '' || based == 2 && letterData.val !== '' && letterData.val !== ' ' || based == 3 && (letterData.n || letterData.val == ' ' || i == len - 1) || based == 4 && (letterData.n || i == len - 1)) {\r\n // eslint-disable-line eqeqeq\r\n if (animatorData.s.rn === 1) {\r\n indexes.push(ind);\r\n }\r\n\r\n ind += 1;\r\n }\r\n }\r\n\r\n data.a[j].s.totalChars = ind;\r\n var currentInd = -1;\r\n var newInd;\r\n\r\n if (animatorData.s.rn === 1) {\r\n for (i = 0; i < len; i += 1) {\r\n letterData = letters[i];\r\n\r\n if (currentInd != letterData.anIndexes[j]) {\r\n // eslint-disable-line eqeqeq\r\n currentInd = letterData.anIndexes[j];\r\n newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];\r\n }\r\n\r\n letterData.anIndexes[j] = newInd;\r\n }\r\n }\r\n }\r\n\r\n documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;\r\n documentData.ls = documentData.ls || 0;\r\n documentData.ascent = fontData.ascent * documentData.finalSize / 100;\r\n };\r\n\r\n TextProperty.prototype.updateDocumentData = function (newData, index) {\r\n index = index === undefined ? this.keysIndex : index;\r\n var dData = this.copyData({}, this.data.d.k[index].s);\r\n dData = this.copyData(dData, newData);\r\n this.data.d.k[index].s = dData;\r\n this.recalculate(index);\r\n this.elem.addDynamicProperty(this);\r\n };\r\n\r\n TextProperty.prototype.recalculate = function (index) {\r\n var dData = this.data.d.k[index].s;\r\n dData.__complete = false;\r\n this.keysIndex = 0;\r\n this._isFirstFrame = true;\r\n this.getValue(dData);\r\n };\r\n\r\n TextProperty.prototype.canResizeFont = function (_canResize) {\r\n this.canResize = _canResize;\r\n this.recalculate(this.keysIndex);\r\n this.elem.addDynamicProperty(this);\r\n };\r\n\r\n TextProperty.prototype.setMinimumFontSize = function (_fontValue) {\r\n this.minimumFontSize = Math.floor(_fontValue) || 1;\r\n this.recalculate(this.keysIndex);\r\n this.elem.addDynamicProperty(this);\r\n };\r\n\r\n var TextSelectorProp = function () {\r\n var max = Math.max;\r\n var min = Math.min;\r\n var floor = Math.floor;\r\n\r\n function TextSelectorPropFactory(elem, data) {\r\n this._currentTextLength = -1;\r\n this.k = false;\r\n this.data = data;\r\n this.elem = elem;\r\n this.comp = elem.comp;\r\n this.finalS = 0;\r\n this.finalE = 0;\r\n this.initDynamicPropertyContainer(elem);\r\n this.s = PropertyFactory.getProp(elem, data.s || {\r\n k: 0\r\n }, 0, 0, this);\r\n\r\n if ('e' in data) {\r\n this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);\r\n } else {\r\n this.e = {\r\n v: 100\r\n };\r\n }\r\n\r\n this.o = PropertyFactory.getProp(elem, data.o || {\r\n k: 0\r\n }, 0, 0, this);\r\n this.xe = PropertyFactory.getProp(elem, data.xe || {\r\n k: 0\r\n }, 0, 0, this);\r\n this.ne = PropertyFactory.getProp(elem, data.ne || {\r\n k: 0\r\n }, 0, 0, this);\r\n this.sm = PropertyFactory.getProp(elem, data.sm || {\r\n k: 100\r\n }, 0, 0, this);\r\n this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);\r\n\r\n if (!this.dynamicProperties.length) {\r\n this.getValue();\r\n }\r\n }\r\n\r\n TextSelectorPropFactory.prototype = {\r\n getMult: function getMult(ind) {\r\n if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {\r\n this.getValue();\r\n }\r\n\r\n var x1 = 0;\r\n var y1 = 0;\r\n var x2 = 1;\r\n var y2 = 1;\r\n\r\n if (this.ne.v > 0) {\r\n x1 = this.ne.v / 100.0;\r\n } else {\r\n y1 = -this.ne.v / 100.0;\r\n }\r\n\r\n if (this.xe.v > 0) {\r\n x2 = 1.0 - this.xe.v / 100.0;\r\n } else {\r\n y2 = 1.0 + this.xe.v / 100.0;\r\n }\r\n\r\n var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;\r\n var mult = 0;\r\n var s = this.finalS;\r\n var e = this.finalE;\r\n var type = this.data.sh;\r\n\r\n if (type === 2) {\r\n if (e === s) {\r\n mult = ind >= e ? 1 : 0;\r\n } else {\r\n mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));\r\n }\r\n\r\n mult = easer(mult);\r\n } else if (type === 3) {\r\n if (e === s) {\r\n mult = ind >= e ? 0 : 1;\r\n } else {\r\n mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));\r\n }\r\n\r\n mult = easer(mult);\r\n } else if (type === 4) {\r\n if (e === s) {\r\n mult = 0;\r\n } else {\r\n mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));\r\n\r\n if (mult < 0.5) {\r\n mult *= 2;\r\n } else {\r\n mult = 1 - 2 * (mult - 0.5);\r\n }\r\n }\r\n\r\n mult = easer(mult);\r\n } else if (type === 5) {\r\n if (e === s) {\r\n mult = 0;\r\n } else {\r\n var tot = e - s;\r\n /* ind += 0.5;\r\n mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */\r\n\r\n ind = min(max(0, ind + 0.5 - s), e - s);\r\n var x = -tot / 2 + ind;\r\n var a = tot / 2;\r\n mult = Math.sqrt(1 - x * x / (a * a));\r\n }\r\n\r\n mult = easer(mult);\r\n } else if (type === 6) {\r\n if (e === s) {\r\n mult = 0;\r\n } else {\r\n ind = min(max(0, ind + 0.5 - s), e - s);\r\n mult = (1 + Math.cos(Math.PI + Math.PI * 2 * ind / (e - s))) / 2; // eslint-disable-line\r\n }\r\n\r\n mult = easer(mult);\r\n } else {\r\n if (ind >= floor(s)) {\r\n if (ind - s < 0) {\r\n mult = max(0, min(min(e, 1) - (s - ind), 1));\r\n } else {\r\n mult = max(0, min(e - ind, 1));\r\n }\r\n }\r\n\r\n mult = easer(mult);\r\n } // Smoothness implementation.\r\n // The smoothness represents a reduced range of the original [0; 1] range.\r\n // if smoothness is 25%, the new range will be [0.375; 0.625]\r\n // Steps are:\r\n // - find the lower value of the new range (threshold)\r\n // - if multiplier is smaller than that value, floor it to 0\r\n // - if it is larger,\r\n // - subtract the threshold\r\n // - divide it by the smoothness (this will return the range to [0; 1])\r\n // Note: If it doesn't work on some scenarios, consider applying it before the easer.\r\n\r\n\r\n if (this.sm.v !== 100) {\r\n var smoothness = this.sm.v * 0.01;\r\n\r\n if (smoothness === 0) {\r\n smoothness = 0.00000001;\r\n }\r\n\r\n var threshold = 0.5 - smoothness * 0.5;\r\n\r\n if (mult < threshold) {\r\n mult = 0;\r\n } else {\r\n mult = (mult - threshold) / smoothness;\r\n\r\n if (mult > 1) {\r\n mult = 1;\r\n }\r\n }\r\n }\r\n\r\n return mult * this.a.v;\r\n },\r\n getValue: function getValue(newCharsFlag) {\r\n this.iterateDynamicProperties();\r\n this._mdf = newCharsFlag || this._mdf;\r\n this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;\r\n\r\n if (newCharsFlag && this.data.r === 2) {\r\n this.e.v = this._currentTextLength;\r\n }\r\n\r\n var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;\r\n var o = this.o.v / divisor;\r\n var s = this.s.v / divisor + o;\r\n var e = this.e.v / divisor + o;\r\n\r\n if (s > e) {\r\n var _s = s;\r\n s = e;\r\n e = _s;\r\n }\r\n\r\n this.finalS = s;\r\n this.finalE = e;\r\n }\r\n };\r\n extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);\r\n\r\n function getTextSelectorProp(elem, data, arr) {\r\n return new TextSelectorPropFactory(elem, data, arr);\r\n }\r\n\r\n return {\r\n getTextSelectorProp: getTextSelectorProp\r\n };\r\n }();\r\n\r\n function TextAnimatorDataProperty(elem, animatorProps, container) {\r\n var defaultData = {\r\n propType: false\r\n };\r\n var getProp = PropertyFactory.getProp;\r\n var textAnimatorAnimatables = animatorProps.a;\r\n this.a = {\r\n r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,\r\n rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,\r\n ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,\r\n sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,\r\n sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,\r\n s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,\r\n a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,\r\n o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,\r\n p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,\r\n sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,\r\n sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,\r\n fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,\r\n fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,\r\n fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,\r\n fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,\r\n t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData\r\n };\r\n this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);\r\n this.s.t = animatorProps.s.t;\r\n }\r\n\r\n function TextAnimatorProperty(textData, renderType, elem) {\r\n this._isFirstFrame = true;\r\n this._hasMaskedPath = false;\r\n this._frameId = -1;\r\n this._textData = textData;\r\n this._renderType = renderType;\r\n this._elem = elem;\r\n this._animatorsData = createSizedArray(this._textData.a.length);\r\n this._pathData = {};\r\n this._moreOptions = {\r\n alignment: {}\r\n };\r\n this.renderedLetters = [];\r\n this.lettersChangedFlag = false;\r\n this.initDynamicPropertyContainer(elem);\r\n }\r\n\r\n TextAnimatorProperty.prototype.searchProperties = function () {\r\n var i;\r\n var len = this._textData.a.length;\r\n var animatorProps;\r\n var getProp = PropertyFactory.getProp;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n animatorProps = this._textData.a[i];\r\n this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);\r\n }\r\n\r\n if (this._textData.p && 'm' in this._textData.p) {\r\n this._pathData = {\r\n a: getProp(this._elem, this._textData.p.a, 0, 0, this),\r\n f: getProp(this._elem, this._textData.p.f, 0, 0, this),\r\n l: getProp(this._elem, this._textData.p.l, 0, 0, this),\r\n r: getProp(this._elem, this._textData.p.r, 0, 0, this),\r\n p: getProp(this._elem, this._textData.p.p, 0, 0, this),\r\n m: this._elem.maskManager.getMaskProperty(this._textData.p.m)\r\n };\r\n this._hasMaskedPath = true;\r\n } else {\r\n this._hasMaskedPath = false;\r\n }\r\n\r\n this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);\r\n };\r\n\r\n TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {\r\n this.lettersChangedFlag = lettersChangedFlag;\r\n\r\n if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {\r\n return;\r\n }\r\n\r\n this._isFirstFrame = false;\r\n var alignment = this._moreOptions.alignment.v;\r\n var animators = this._animatorsData;\r\n var textData = this._textData;\r\n var matrixHelper = this.mHelper;\r\n var renderType = this._renderType;\r\n var renderedLettersCount = this.renderedLetters.length;\r\n var xPos;\r\n var yPos;\r\n var i;\r\n var len;\r\n var letters = documentData.l;\r\n var pathInfo;\r\n var currentLength;\r\n var currentPoint;\r\n var segmentLength;\r\n var flag;\r\n var pointInd;\r\n var segmentInd;\r\n var prevPoint;\r\n var points;\r\n var segments;\r\n var partialLength;\r\n var totalLength;\r\n var perc;\r\n var tanAngle;\r\n var mask;\r\n\r\n if (this._hasMaskedPath) {\r\n mask = this._pathData.m;\r\n\r\n if (!this._pathData.n || this._pathData._mdf) {\r\n var paths = mask.v;\r\n\r\n if (this._pathData.r.v) {\r\n paths = paths.reverse();\r\n } // TODO: release bezier data cached from previous pathInfo: this._pathData.pi\r\n\r\n\r\n pathInfo = {\r\n tLength: 0,\r\n segments: []\r\n };\r\n len = paths._length - 1;\r\n var bezierData;\r\n totalLength = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n bezierData = bez.buildBezierData(paths.v[i], paths.v[i + 1], [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]], [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]);\r\n pathInfo.tLength += bezierData.segmentLength;\r\n pathInfo.segments.push(bezierData);\r\n totalLength += bezierData.segmentLength;\r\n }\r\n\r\n i = len;\r\n\r\n if (mask.v.c) {\r\n bezierData = bez.buildBezierData(paths.v[i], paths.v[0], [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]], [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]);\r\n pathInfo.tLength += bezierData.segmentLength;\r\n pathInfo.segments.push(bezierData);\r\n totalLength += bezierData.segmentLength;\r\n }\r\n\r\n this._pathData.pi = pathInfo;\r\n }\r\n\r\n pathInfo = this._pathData.pi;\r\n currentLength = this._pathData.f.v;\r\n segmentInd = 0;\r\n pointInd = 1;\r\n segmentLength = 0;\r\n flag = true;\r\n segments = pathInfo.segments;\r\n\r\n if (currentLength < 0 && mask.v.c) {\r\n if (pathInfo.tLength < Math.abs(currentLength)) {\r\n currentLength = -Math.abs(currentLength) % pathInfo.tLength;\r\n }\r\n\r\n segmentInd = segments.length - 1;\r\n points = segments[segmentInd].points;\r\n pointInd = points.length - 1;\r\n\r\n while (currentLength < 0) {\r\n currentLength += points[pointInd].partialLength;\r\n pointInd -= 1;\r\n\r\n if (pointInd < 0) {\r\n segmentInd -= 1;\r\n points = segments[segmentInd].points;\r\n pointInd = points.length - 1;\r\n }\r\n }\r\n }\r\n\r\n points = segments[segmentInd].points;\r\n prevPoint = points[pointInd - 1];\r\n currentPoint = points[pointInd];\r\n partialLength = currentPoint.partialLength;\r\n }\r\n\r\n len = letters.length;\r\n xPos = 0;\r\n yPos = 0;\r\n var yOff = documentData.finalSize * 1.2 * 0.714;\r\n var firstLine = true;\r\n var animatorProps;\r\n var animatorSelector;\r\n var j;\r\n var jLen;\r\n var letterValue;\r\n jLen = animators.length;\r\n var mult;\r\n var ind = -1;\r\n var offf;\r\n var xPathPos;\r\n var yPathPos;\r\n var initPathPos = currentLength;\r\n var initSegmentInd = segmentInd;\r\n var initPointInd = pointInd;\r\n var currentLine = -1;\r\n var elemOpacity;\r\n var sc;\r\n var sw;\r\n var fc;\r\n var k;\r\n var letterSw;\r\n var letterSc;\r\n var letterFc;\r\n var letterM = '';\r\n var letterP = this.defaultPropsArray;\r\n var letterO; //\r\n\r\n if (documentData.j === 2 || documentData.j === 1) {\r\n var animatorJustifyOffset = 0;\r\n var animatorFirstCharOffset = 0;\r\n var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;\r\n var lastIndex = 0;\r\n var isNewLine = true;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (letters[i].n) {\r\n if (animatorJustifyOffset) {\r\n animatorJustifyOffset += animatorFirstCharOffset;\r\n }\r\n\r\n while (lastIndex < i) {\r\n letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;\r\n lastIndex += 1;\r\n }\r\n\r\n animatorJustifyOffset = 0;\r\n isNewLine = true;\r\n } else {\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n\r\n if (animatorProps.t.propType) {\r\n if (isNewLine && documentData.j === 2) {\r\n animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;\r\n }\r\n\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (mult.length) {\r\n animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;\r\n } else {\r\n animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;\r\n }\r\n }\r\n }\r\n\r\n isNewLine = false;\r\n }\r\n }\r\n\r\n if (animatorJustifyOffset) {\r\n animatorJustifyOffset += animatorFirstCharOffset;\r\n }\r\n\r\n while (lastIndex < i) {\r\n letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;\r\n lastIndex += 1;\r\n }\r\n } //\r\n\r\n\r\n for (i = 0; i < len; i += 1) {\r\n matrixHelper.reset();\r\n elemOpacity = 1;\r\n\r\n if (letters[i].n) {\r\n xPos = 0;\r\n yPos += documentData.yOffset;\r\n yPos += firstLine ? 1 : 0;\r\n currentLength = initPathPos;\r\n firstLine = false;\r\n\r\n if (this._hasMaskedPath) {\r\n segmentInd = initSegmentInd;\r\n pointInd = initPointInd;\r\n points = segments[segmentInd].points;\r\n prevPoint = points[pointInd - 1];\r\n currentPoint = points[pointInd];\r\n partialLength = currentPoint.partialLength;\r\n segmentLength = 0;\r\n }\r\n\r\n letterM = '';\r\n letterFc = '';\r\n letterSw = '';\r\n letterO = '';\r\n letterP = this.defaultPropsArray;\r\n } else {\r\n if (this._hasMaskedPath) {\r\n if (currentLine !== letters[i].line) {\r\n switch (documentData.j) {\r\n case 1:\r\n currentLength += totalLength - documentData.lineWidths[letters[i].line];\r\n break;\r\n\r\n case 2:\r\n currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n currentLine = letters[i].line;\r\n }\r\n\r\n if (ind !== letters[i].ind) {\r\n if (letters[ind]) {\r\n currentLength += letters[ind].extra;\r\n }\r\n\r\n currentLength += letters[i].an / 2;\r\n ind = letters[i].ind;\r\n }\r\n\r\n currentLength += alignment[0] * letters[i].an * 0.005;\r\n var animatorOffset = 0;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n\r\n if (animatorProps.p.propType) {\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (mult.length) {\r\n animatorOffset += animatorProps.p.v[0] * mult[0];\r\n } else {\r\n animatorOffset += animatorProps.p.v[0] * mult;\r\n }\r\n }\r\n\r\n if (animatorProps.a.propType) {\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (mult.length) {\r\n animatorOffset += animatorProps.a.v[0] * mult[0];\r\n } else {\r\n animatorOffset += animatorProps.a.v[0] * mult;\r\n }\r\n }\r\n }\r\n\r\n flag = true; // Force alignment only works with a single line for now\r\n\r\n if (this._pathData.a.v) {\r\n currentLength = letters[0].an * 0.5 + (totalLength - this._pathData.f.v - letters[0].an * 0.5 - letters[letters.length - 1].an * 0.5) * ind / (len - 1);\r\n currentLength += this._pathData.f.v;\r\n }\r\n\r\n while (flag) {\r\n if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {\r\n perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;\r\n xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;\r\n yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;\r\n matrixHelper.translate(-alignment[0] * letters[i].an * 0.005, -(alignment[1] * yOff) * 0.01);\r\n flag = false;\r\n } else if (points) {\r\n segmentLength += currentPoint.partialLength;\r\n pointInd += 1;\r\n\r\n if (pointInd >= points.length) {\r\n pointInd = 0;\r\n segmentInd += 1;\r\n\r\n if (!segments[segmentInd]) {\r\n if (mask.v.c) {\r\n pointInd = 0;\r\n segmentInd = 0;\r\n points = segments[segmentInd].points;\r\n } else {\r\n segmentLength -= currentPoint.partialLength;\r\n points = null;\r\n }\r\n } else {\r\n points = segments[segmentInd].points;\r\n }\r\n }\r\n\r\n if (points) {\r\n prevPoint = currentPoint;\r\n currentPoint = points[pointInd];\r\n partialLength = currentPoint.partialLength;\r\n }\r\n }\r\n }\r\n\r\n offf = letters[i].an / 2 - letters[i].add;\r\n matrixHelper.translate(-offf, 0, 0);\r\n } else {\r\n offf = letters[i].an / 2 - letters[i].add;\r\n matrixHelper.translate(-offf, 0, 0); // Grouping alignment\r\n\r\n matrixHelper.translate(-alignment[0] * letters[i].an * 0.005, -alignment[1] * yOff * 0.01, 0);\r\n }\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n\r\n if (animatorProps.t.propType) {\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); // This condition is to prevent applying tracking to first character in each line. Might be better to use a boolean \"isNewLine\"\r\n\r\n if (xPos !== 0 || documentData.j !== 0) {\r\n if (this._hasMaskedPath) {\r\n if (mult.length) {\r\n currentLength += animatorProps.t.v * mult[0];\r\n } else {\r\n currentLength += animatorProps.t.v * mult;\r\n }\r\n } else if (mult.length) {\r\n xPos += animatorProps.t.v * mult[0];\r\n } else {\r\n xPos += animatorProps.t.v * mult;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (documentData.strokeWidthAnim) {\r\n sw = documentData.sw || 0;\r\n }\r\n\r\n if (documentData.strokeColorAnim) {\r\n if (documentData.sc) {\r\n sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];\r\n } else {\r\n sc = [0, 0, 0];\r\n }\r\n }\r\n\r\n if (documentData.fillColorAnim && documentData.fc) {\r\n fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];\r\n }\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n\r\n if (animatorProps.a.propType) {\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (mult.length) {\r\n matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);\r\n } else {\r\n matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);\r\n }\r\n }\r\n }\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n\r\n if (animatorProps.s.propType) {\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (mult.length) {\r\n matrixHelper.scale(1 + (animatorProps.s.v[0] - 1) * mult[0], 1 + (animatorProps.s.v[1] - 1) * mult[1], 1);\r\n } else {\r\n matrixHelper.scale(1 + (animatorProps.s.v[0] - 1) * mult, 1 + (animatorProps.s.v[1] - 1) * mult, 1);\r\n }\r\n }\r\n }\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (animatorProps.sk.propType) {\r\n if (mult.length) {\r\n matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);\r\n } else {\r\n matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);\r\n }\r\n }\r\n\r\n if (animatorProps.r.propType) {\r\n if (mult.length) {\r\n matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);\r\n } else {\r\n matrixHelper.rotateZ(-animatorProps.r.v * mult);\r\n }\r\n }\r\n\r\n if (animatorProps.ry.propType) {\r\n if (mult.length) {\r\n matrixHelper.rotateY(animatorProps.ry.v * mult[1]);\r\n } else {\r\n matrixHelper.rotateY(animatorProps.ry.v * mult);\r\n }\r\n }\r\n\r\n if (animatorProps.rx.propType) {\r\n if (mult.length) {\r\n matrixHelper.rotateX(animatorProps.rx.v * mult[0]);\r\n } else {\r\n matrixHelper.rotateX(animatorProps.rx.v * mult);\r\n }\r\n }\r\n\r\n if (animatorProps.o.propType) {\r\n if (mult.length) {\r\n elemOpacity += (animatorProps.o.v * mult[0] - elemOpacity) * mult[0];\r\n } else {\r\n elemOpacity += (animatorProps.o.v * mult - elemOpacity) * mult;\r\n }\r\n }\r\n\r\n if (documentData.strokeWidthAnim && animatorProps.sw.propType) {\r\n if (mult.length) {\r\n sw += animatorProps.sw.v * mult[0];\r\n } else {\r\n sw += animatorProps.sw.v * mult;\r\n }\r\n }\r\n\r\n if (documentData.strokeColorAnim && animatorProps.sc.propType) {\r\n for (k = 0; k < 3; k += 1) {\r\n if (mult.length) {\r\n sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];\r\n } else {\r\n sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;\r\n }\r\n }\r\n }\r\n\r\n if (documentData.fillColorAnim && documentData.fc) {\r\n if (animatorProps.fc.propType) {\r\n for (k = 0; k < 3; k += 1) {\r\n if (mult.length) {\r\n fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];\r\n } else {\r\n fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;\r\n }\r\n }\r\n }\r\n\r\n if (animatorProps.fh.propType) {\r\n if (mult.length) {\r\n fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);\r\n } else {\r\n fc = addHueToRGB(fc, animatorProps.fh.v * mult);\r\n }\r\n }\r\n\r\n if (animatorProps.fs.propType) {\r\n if (mult.length) {\r\n fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);\r\n } else {\r\n fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);\r\n }\r\n }\r\n\r\n if (animatorProps.fb.propType) {\r\n if (mult.length) {\r\n fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);\r\n } else {\r\n fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n animatorProps = animators[j].a;\r\n\r\n if (animatorProps.p.propType) {\r\n animatorSelector = animators[j].s;\r\n mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);\r\n\r\n if (this._hasMaskedPath) {\r\n if (mult.length) {\r\n matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);\r\n } else {\r\n matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);\r\n }\r\n } else if (mult.length) {\r\n matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);\r\n } else {\r\n matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);\r\n }\r\n }\r\n }\r\n\r\n if (documentData.strokeWidthAnim) {\r\n letterSw = sw < 0 ? 0 : sw;\r\n }\r\n\r\n if (documentData.strokeColorAnim) {\r\n letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';\r\n }\r\n\r\n if (documentData.fillColorAnim && documentData.fc) {\r\n letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';\r\n }\r\n\r\n if (this._hasMaskedPath) {\r\n matrixHelper.translate(0, -documentData.ls);\r\n matrixHelper.translate(0, alignment[1] * yOff * 0.01 + yPos, 0);\r\n\r\n if (this._pathData.p.v) {\r\n tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);\r\n var rot = Math.atan(tanAngle) * 180 / Math.PI;\r\n\r\n if (currentPoint.point[0] < prevPoint.point[0]) {\r\n rot += 180;\r\n }\r\n\r\n matrixHelper.rotate(-rot * Math.PI / 180);\r\n }\r\n\r\n matrixHelper.translate(xPathPos, yPathPos, 0);\r\n currentLength -= alignment[0] * letters[i].an * 0.005;\r\n\r\n if (letters[i + 1] && ind !== letters[i + 1].ind) {\r\n currentLength += letters[i].an / 2;\r\n currentLength += documentData.tr * 0.001 * documentData.finalSize;\r\n }\r\n } else {\r\n matrixHelper.translate(xPos, yPos, 0);\r\n\r\n if (documentData.ps) {\r\n // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);\r\n matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);\r\n }\r\n\r\n switch (documentData.j) {\r\n case 1:\r\n matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);\r\n break;\r\n\r\n case 2:\r\n matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n matrixHelper.translate(0, -documentData.ls);\r\n matrixHelper.translate(offf, 0, 0);\r\n matrixHelper.translate(alignment[0] * letters[i].an * 0.005, alignment[1] * yOff * 0.01, 0);\r\n xPos += letters[i].l + documentData.tr * 0.001 * documentData.finalSize;\r\n }\r\n\r\n if (renderType === 'html') {\r\n letterM = matrixHelper.toCSS();\r\n } else if (renderType === 'svg') {\r\n letterM = matrixHelper.to2dCSS();\r\n } else {\r\n letterP = [matrixHelper.props[0], matrixHelper.props[1], matrixHelper.props[2], matrixHelper.props[3], matrixHelper.props[4], matrixHelper.props[5], matrixHelper.props[6], matrixHelper.props[7], matrixHelper.props[8], matrixHelper.props[9], matrixHelper.props[10], matrixHelper.props[11], matrixHelper.props[12], matrixHelper.props[13], matrixHelper.props[14], matrixHelper.props[15]];\r\n }\r\n\r\n letterO = elemOpacity;\r\n }\r\n\r\n if (renderedLettersCount <= i) {\r\n letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);\r\n this.renderedLetters.push(letterValue);\r\n renderedLettersCount += 1;\r\n this.lettersChangedFlag = true;\r\n } else {\r\n letterValue = this.renderedLetters[i];\r\n this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;\r\n }\r\n }\r\n };\r\n\r\n TextAnimatorProperty.prototype.getValue = function () {\r\n if (this._elem.globalData.frameId === this._frameId) {\r\n return;\r\n }\r\n\r\n this._frameId = this._elem.globalData.frameId;\r\n this.iterateDynamicProperties();\r\n };\r\n\r\n TextAnimatorProperty.prototype.mHelper = new Matrix();\r\n TextAnimatorProperty.prototype.defaultPropsArray = [];\r\n extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);\r\n\r\n function ITextElement() {}\r\n\r\n ITextElement.prototype.initElement = function (data, globalData, comp) {\r\n this.lettersChangedFlag = true;\r\n this.initFrame();\r\n this.initBaseData(data, globalData, comp);\r\n this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);\r\n this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);\r\n this.initTransform(data, globalData, comp);\r\n this.initHierarchy();\r\n this.initRenderable();\r\n this.initRendererElement();\r\n this.createContainerElements();\r\n this.createRenderableComponents();\r\n this.createContent();\r\n this.hide();\r\n this.textAnimator.searchProperties(this.dynamicProperties);\r\n };\r\n\r\n ITextElement.prototype.prepareFrame = function (num) {\r\n this._mdf = false;\r\n this.prepareRenderableFrame(num);\r\n this.prepareProperties(num, this.isInRange);\r\n\r\n if (this.textProperty._mdf || this.textProperty._isFirstFrame) {\r\n this.buildNewText();\r\n this.textProperty._isFirstFrame = false;\r\n this.textProperty._mdf = false;\r\n }\r\n };\r\n\r\n ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {\r\n var j;\r\n var jLen = shapes.length;\r\n var pathNodes;\r\n var shapeStr = '';\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (shapes[j].ty === 'sh') {\r\n pathNodes = shapes[j].ks.k;\r\n shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);\r\n }\r\n }\r\n\r\n return shapeStr;\r\n };\r\n\r\n ITextElement.prototype.updateDocumentData = function (newData, index) {\r\n this.textProperty.updateDocumentData(newData, index);\r\n };\r\n\r\n ITextElement.prototype.canResizeFont = function (_canResize) {\r\n this.textProperty.canResizeFont(_canResize);\r\n };\r\n\r\n ITextElement.prototype.setMinimumFontSize = function (_fontSize) {\r\n this.textProperty.setMinimumFontSize(_fontSize);\r\n };\r\n\r\n ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {\r\n if (documentData.ps) {\r\n matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);\r\n }\r\n\r\n matrixHelper.translate(0, -documentData.ls, 0);\r\n\r\n switch (documentData.j) {\r\n case 1:\r\n matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);\r\n break;\r\n\r\n case 2:\r\n matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n matrixHelper.translate(xPos, yPos, 0);\r\n };\r\n\r\n ITextElement.prototype.buildColor = function (colorData) {\r\n return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';\r\n };\r\n\r\n ITextElement.prototype.emptyProp = new LetterProps();\r\n\r\n ITextElement.prototype.destroy = function () {};\r\n\r\n var emptyShapeData = {\r\n shapes: []\r\n };\r\n\r\n function SVGTextLottieElement(data, globalData, comp) {\r\n this.textSpans = [];\r\n this.renderType = 'svg';\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);\r\n\r\n SVGTextLottieElement.prototype.createContent = function () {\r\n if (this.data.singleShape && !this.globalData.fontManager.chars) {\r\n this.textContainer = createNS('text');\r\n }\r\n };\r\n\r\n SVGTextLottieElement.prototype.buildTextContents = function (textArray) {\r\n var i = 0;\r\n var len = textArray.length;\r\n var textContents = [];\r\n var currentTextContent = '';\r\n\r\n while (i < len) {\r\n if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {\r\n textContents.push(currentTextContent);\r\n currentTextContent = '';\r\n } else {\r\n currentTextContent += textArray[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n textContents.push(currentTextContent);\r\n return textContents;\r\n };\r\n\r\n SVGTextLottieElement.prototype.buildShapeData = function (data, scale) {\r\n // data should probably be cloned to apply scale separately to each instance of a text on different layers\r\n // but since text internal content gets only rendered once and then it's never rerendered,\r\n // it's probably safe not to clone data and reuse always the same instance even if the object is mutated.\r\n // Avoiding cloning is preferred since cloning each character shape data is expensive\r\n if (data.shapes && data.shapes.length) {\r\n var shape = data.shapes[0];\r\n\r\n if (shape.it) {\r\n var shapeItem = shape.it[shape.it.length - 1];\r\n\r\n if (shapeItem.s) {\r\n shapeItem.s.k[0] = scale;\r\n shapeItem.s.k[1] = scale;\r\n }\r\n }\r\n }\r\n\r\n return data;\r\n };\r\n\r\n SVGTextLottieElement.prototype.buildNewText = function () {\r\n this.addDynamicProperty(this);\r\n var i;\r\n var len;\r\n var documentData = this.textProperty.currentData;\r\n this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);\r\n\r\n if (documentData.fc) {\r\n this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));\r\n } else {\r\n this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');\r\n }\r\n\r\n if (documentData.sc) {\r\n this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));\r\n this.layerElement.setAttribute('stroke-width', documentData.sw);\r\n }\r\n\r\n this.layerElement.setAttribute('font-size', documentData.finalSize);\r\n var fontData = this.globalData.fontManager.getFontByName(documentData.f);\r\n\r\n if (fontData.fClass) {\r\n this.layerElement.setAttribute('class', fontData.fClass);\r\n } else {\r\n this.layerElement.setAttribute('font-family', fontData.fFamily);\r\n var fWeight = documentData.fWeight;\r\n var fStyle = documentData.fStyle;\r\n this.layerElement.setAttribute('font-style', fStyle);\r\n this.layerElement.setAttribute('font-weight', fWeight);\r\n }\r\n\r\n this.layerElement.setAttribute('aria-label', documentData.t);\r\n var letters = documentData.l || [];\r\n var usesGlyphs = !!this.globalData.fontManager.chars;\r\n len = letters.length;\r\n var tSpan;\r\n var matrixHelper = this.mHelper;\r\n var shapeStr = '';\r\n var singleShape = this.data.singleShape;\r\n var xPos = 0;\r\n var yPos = 0;\r\n var firstLine = true;\r\n var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;\r\n\r\n if (singleShape && !usesGlyphs && !documentData.sz) {\r\n var tElement = this.textContainer;\r\n var justify = 'start';\r\n\r\n switch (documentData.j) {\r\n case 1:\r\n justify = 'end';\r\n break;\r\n\r\n case 2:\r\n justify = 'middle';\r\n break;\r\n\r\n default:\r\n justify = 'start';\r\n break;\r\n }\r\n\r\n tElement.setAttribute('text-anchor', justify);\r\n tElement.setAttribute('letter-spacing', trackingOffset);\r\n var textContent = this.buildTextContents(documentData.finalText);\r\n len = textContent.length;\r\n yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n tSpan = this.textSpans[i].span || createNS('tspan');\r\n tSpan.textContent = textContent[i];\r\n tSpan.setAttribute('x', 0);\r\n tSpan.setAttribute('y', yPos);\r\n tSpan.style.display = 'inherit';\r\n tElement.appendChild(tSpan);\r\n\r\n if (!this.textSpans[i]) {\r\n this.textSpans[i] = {\r\n span: null,\r\n glyph: null\r\n };\r\n }\r\n\r\n this.textSpans[i].span = tSpan;\r\n yPos += documentData.finalLineHeight;\r\n }\r\n\r\n this.layerElement.appendChild(tElement);\r\n } else {\r\n var cachedSpansLength = this.textSpans.length;\r\n var charData;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!this.textSpans[i]) {\r\n this.textSpans[i] = {\r\n span: null,\r\n childSpan: null,\r\n glyph: null\r\n };\r\n }\r\n\r\n if (!usesGlyphs || !singleShape || i === 0) {\r\n tSpan = cachedSpansLength > i ? this.textSpans[i].span : createNS(usesGlyphs ? 'g' : 'text');\r\n\r\n if (cachedSpansLength <= i) {\r\n tSpan.setAttribute('stroke-linecap', 'butt');\r\n tSpan.setAttribute('stroke-linejoin', 'round');\r\n tSpan.setAttribute('stroke-miterlimit', '4');\r\n this.textSpans[i].span = tSpan;\r\n\r\n if (usesGlyphs) {\r\n var childSpan = createNS('g');\r\n tSpan.appendChild(childSpan);\r\n this.textSpans[i].childSpan = childSpan;\r\n }\r\n\r\n this.textSpans[i].span = tSpan;\r\n this.layerElement.appendChild(tSpan);\r\n }\r\n\r\n tSpan.style.display = 'inherit';\r\n }\r\n\r\n matrixHelper.reset();\r\n\r\n if (singleShape) {\r\n if (letters[i].n) {\r\n xPos = -trackingOffset;\r\n yPos += documentData.yOffset;\r\n yPos += firstLine ? 1 : 0;\r\n firstLine = false;\r\n }\r\n\r\n this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);\r\n xPos += letters[i].l || 0; // xPos += letters[i].val === ' ' ? 0 : trackingOffset;\r\n\r\n xPos += trackingOffset;\r\n }\r\n\r\n if (usesGlyphs) {\r\n charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);\r\n var glyphElement; // t === 1 means the character has been replaced with an animated shaped\r\n\r\n if (charData.t === 1) {\r\n glyphElement = new SVGCompElement(charData.data, this.globalData, this);\r\n } else {\r\n var data = emptyShapeData;\r\n\r\n if (charData.data && charData.data.shapes) {\r\n data = this.buildShapeData(charData.data, documentData.finalSize);\r\n }\r\n\r\n glyphElement = new SVGShapeElement(data, this.globalData, this);\r\n }\r\n\r\n if (this.textSpans[i].glyph) {\r\n var glyph = this.textSpans[i].glyph;\r\n this.textSpans[i].childSpan.removeChild(glyph.layerElement);\r\n glyph.destroy();\r\n }\r\n\r\n this.textSpans[i].glyph = glyphElement;\r\n glyphElement._debug = true;\r\n glyphElement.prepareFrame(0);\r\n glyphElement.renderFrame();\r\n this.textSpans[i].childSpan.appendChild(glyphElement.layerElement); // when using animated shapes, the layer will be scaled instead of replacing the internal scale\r\n // this might have issues with strokes and might need a different solution\r\n\r\n if (charData.t === 1) {\r\n this.textSpans[i].childSpan.setAttribute('transform', 'scale(' + documentData.finalSize / 100 + ',' + documentData.finalSize / 100 + ')');\r\n }\r\n } else {\r\n if (singleShape) {\r\n tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');\r\n }\r\n\r\n tSpan.textContent = letters[i].val;\r\n tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\r\n } //\r\n\r\n }\r\n\r\n if (singleShape && tSpan) {\r\n tSpan.setAttribute('d', shapeStr);\r\n }\r\n }\r\n\r\n while (i < this.textSpans.length) {\r\n this.textSpans[i].span.style.display = 'none';\r\n i += 1;\r\n }\r\n\r\n this._sizeChanged = true;\r\n };\r\n\r\n SVGTextLottieElement.prototype.sourceRectAtTime = function () {\r\n this.prepareFrame(this.comp.renderedFrame - this.data.st);\r\n this.renderInnerContent();\r\n\r\n if (this._sizeChanged) {\r\n this._sizeChanged = false;\r\n var textBox = this.layerElement.getBBox();\r\n this.bbox = {\r\n top: textBox.y,\r\n left: textBox.x,\r\n width: textBox.width,\r\n height: textBox.height\r\n };\r\n }\r\n\r\n return this.bbox;\r\n };\r\n\r\n SVGTextLottieElement.prototype.getValue = function () {\r\n var i;\r\n var len = this.textSpans.length;\r\n var glyphElement;\r\n this.renderedFrame = this.comp.renderedFrame;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n glyphElement = this.textSpans[i].glyph;\r\n\r\n if (glyphElement) {\r\n glyphElement.prepareFrame(this.comp.renderedFrame - this.data.st);\r\n\r\n if (glyphElement._mdf) {\r\n this._mdf = true;\r\n }\r\n }\r\n }\r\n };\r\n\r\n SVGTextLottieElement.prototype.renderInnerContent = function () {\r\n if (!this.data.singleShape || this._mdf) {\r\n this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);\r\n\r\n if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {\r\n this._sizeChanged = true;\r\n var i;\r\n var len;\r\n var renderedLetters = this.textAnimator.renderedLetters;\r\n var letters = this.textProperty.currentData.l;\r\n len = letters.length;\r\n var renderedLetter;\r\n var textSpan;\r\n var glyphElement;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!letters[i].n) {\r\n renderedLetter = renderedLetters[i];\r\n textSpan = this.textSpans[i].span;\r\n glyphElement = this.textSpans[i].glyph;\r\n\r\n if (glyphElement) {\r\n glyphElement.renderFrame();\r\n }\r\n\r\n if (renderedLetter._mdf.m) {\r\n textSpan.setAttribute('transform', renderedLetter.m);\r\n }\r\n\r\n if (renderedLetter._mdf.o) {\r\n textSpan.setAttribute('opacity', renderedLetter.o);\r\n }\r\n\r\n if (renderedLetter._mdf.sw) {\r\n textSpan.setAttribute('stroke-width', renderedLetter.sw);\r\n }\r\n\r\n if (renderedLetter._mdf.sc) {\r\n textSpan.setAttribute('stroke', renderedLetter.sc);\r\n }\r\n\r\n if (renderedLetter._mdf.fc) {\r\n textSpan.setAttribute('fill', renderedLetter.fc);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n function ISolidElement(data, globalData, comp) {\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([IImageElement], ISolidElement);\r\n\r\n ISolidElement.prototype.createContent = function () {\r\n var rect = createNS('rect'); /// /rect.style.width = this.data.sw;\r\n /// /rect.style.height = this.data.sh;\r\n /// /rect.style.fill = this.data.sc;\r\n\r\n rect.setAttribute('width', this.data.sw);\r\n rect.setAttribute('height', this.data.sh);\r\n rect.setAttribute('fill', this.data.sc);\r\n this.layerElement.appendChild(rect);\r\n };\r\n\r\n function NullElement(data, globalData, comp) {\r\n this.initFrame();\r\n this.initBaseData(data, globalData, comp);\r\n this.initFrame();\r\n this.initTransform(data, globalData, comp);\r\n this.initHierarchy();\r\n }\r\n\r\n NullElement.prototype.prepareFrame = function (num) {\r\n this.prepareProperties(num, true);\r\n };\r\n\r\n NullElement.prototype.renderFrame = function () {};\r\n\r\n NullElement.prototype.getBaseElement = function () {\r\n return null;\r\n };\r\n\r\n NullElement.prototype.destroy = function () {};\r\n\r\n NullElement.prototype.sourceRectAtTime = function () {};\r\n\r\n NullElement.prototype.hide = function () {};\r\n\r\n extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);\r\n\r\n function SVGRendererBase() {}\r\n\r\n extendPrototype([BaseRenderer], SVGRendererBase);\r\n\r\n SVGRendererBase.prototype.createNull = function (data) {\r\n return new NullElement(data, this.globalData, this);\r\n };\r\n\r\n SVGRendererBase.prototype.createShape = function (data) {\r\n return new SVGShapeElement(data, this.globalData, this);\r\n };\r\n\r\n SVGRendererBase.prototype.createText = function (data) {\r\n return new SVGTextLottieElement(data, this.globalData, this);\r\n };\r\n\r\n SVGRendererBase.prototype.createImage = function (data) {\r\n return new IImageElement(data, this.globalData, this);\r\n };\r\n\r\n SVGRendererBase.prototype.createSolid = function (data) {\r\n return new ISolidElement(data, this.globalData, this);\r\n };\r\n\r\n SVGRendererBase.prototype.configAnimation = function (animData) {\r\n this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n this.svgElement.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\r\n\r\n if (this.renderConfig.viewBoxSize) {\r\n this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);\r\n } else {\r\n this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);\r\n }\r\n\r\n if (!this.renderConfig.viewBoxOnly) {\r\n this.svgElement.setAttribute('width', animData.w);\r\n this.svgElement.setAttribute('height', animData.h);\r\n this.svgElement.style.width = '100%';\r\n this.svgElement.style.height = '100%';\r\n this.svgElement.style.transform = 'translate3d(0,0,0)';\r\n this.svgElement.style.contentVisibility = this.renderConfig.contentVisibility;\r\n }\r\n\r\n if (this.renderConfig.width) {\r\n this.svgElement.setAttribute('width', this.renderConfig.width);\r\n }\r\n\r\n if (this.renderConfig.height) {\r\n this.svgElement.setAttribute('height', this.renderConfig.height);\r\n }\r\n\r\n if (this.renderConfig.className) {\r\n this.svgElement.setAttribute('class', this.renderConfig.className);\r\n }\r\n\r\n if (this.renderConfig.id) {\r\n this.svgElement.setAttribute('id', this.renderConfig.id);\r\n }\r\n\r\n if (this.renderConfig.focusable !== undefined) {\r\n this.svgElement.setAttribute('focusable', this.renderConfig.focusable);\r\n }\r\n\r\n this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio); // this.layerElement.style.transform = 'translate3d(0,0,0)';\r\n // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = \"0px 0px 0px\";\r\n\r\n this.animationItem.wrapper.appendChild(this.svgElement); // Mask animation\r\n\r\n var defs = this.globalData.defs;\r\n this.setupGlobalData(animData, defs);\r\n this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;\r\n this.data = animData;\r\n var maskElement = createNS('clipPath');\r\n var rect = createNS('rect');\r\n rect.setAttribute('width', animData.w);\r\n rect.setAttribute('height', animData.h);\r\n rect.setAttribute('x', 0);\r\n rect.setAttribute('y', 0);\r\n var maskId = createElementID();\r\n maskElement.setAttribute('id', maskId);\r\n maskElement.appendChild(rect);\r\n this.layerElement.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + maskId + ')');\r\n defs.appendChild(maskElement);\r\n this.layers = animData.layers;\r\n this.elements = createSizedArray(animData.layers.length);\r\n };\r\n\r\n SVGRendererBase.prototype.destroy = function () {\r\n if (this.animationItem.wrapper) {\r\n this.animationItem.wrapper.innerText = '';\r\n }\r\n\r\n this.layerElement = null;\r\n this.globalData.defs = null;\r\n var i;\r\n var len = this.layers ? this.layers.length : 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.elements[i]) {\r\n this.elements[i].destroy();\r\n }\r\n }\r\n\r\n this.elements.length = 0;\r\n this.destroyed = true;\r\n this.animationItem = null;\r\n };\r\n\r\n SVGRendererBase.prototype.updateContainerSize = function () {};\r\n\r\n SVGRendererBase.prototype.findIndexByInd = function (ind) {\r\n var i = 0;\r\n var len = this.layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.layers[i].ind === ind) {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n };\r\n\r\n SVGRendererBase.prototype.buildItem = function (pos) {\r\n var elements = this.elements;\r\n\r\n if (elements[pos] || this.layers[pos].ty === 99) {\r\n return;\r\n }\r\n\r\n elements[pos] = true;\r\n var element = this.createItem(this.layers[pos]);\r\n elements[pos] = element;\r\n\r\n if (getExpressionsPlugin()) {\r\n if (this.layers[pos].ty === 0) {\r\n this.globalData.projectInterface.registerComposition(element);\r\n }\r\n\r\n element.initExpressions();\r\n }\r\n\r\n this.appendElementInPos(element, pos);\r\n\r\n if (this.layers[pos].tt) {\r\n var elementIndex = 'tp' in this.layers[pos] ? this.findIndexByInd(this.layers[pos].tp) : pos - 1;\r\n\r\n if (elementIndex === -1) {\r\n return;\r\n }\r\n\r\n if (!this.elements[elementIndex] || this.elements[elementIndex] === true) {\r\n this.buildItem(elementIndex);\r\n this.addPendingElement(element);\r\n } else {\r\n var matteElement = elements[elementIndex];\r\n var matteMask = matteElement.getMatte(this.layers[pos].tt);\r\n element.setMatte(matteMask);\r\n }\r\n }\r\n };\r\n\r\n SVGRendererBase.prototype.checkPendingElements = function () {\r\n while (this.pendingElements.length) {\r\n var element = this.pendingElements.pop();\r\n element.checkParenting();\r\n\r\n if (element.data.tt) {\r\n var i = 0;\r\n var len = this.elements.length;\r\n\r\n while (i < len) {\r\n if (this.elements[i] === element) {\r\n var elementIndex = 'tp' in element.data ? this.findIndexByInd(element.data.tp) : i - 1;\r\n var matteElement = this.elements[elementIndex];\r\n var matteMask = matteElement.getMatte(this.layers[i].tt);\r\n element.setMatte(matteMask);\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n }\r\n }\r\n };\r\n\r\n SVGRendererBase.prototype.renderFrame = function (num) {\r\n if (this.renderedFrame === num || this.destroyed) {\r\n return;\r\n }\r\n\r\n if (num === null) {\r\n num = this.renderedFrame;\r\n } else {\r\n this.renderedFrame = num;\r\n } // console.log('-------');\r\n // console.log('FRAME ',num);\r\n\r\n\r\n this.globalData.frameNum = num;\r\n this.globalData.frameId += 1;\r\n this.globalData.projectInterface.currentFrame = num;\r\n this.globalData._mdf = false;\r\n var i;\r\n var len = this.layers.length;\r\n\r\n if (!this.completeLayers) {\r\n this.checkLayers(num);\r\n }\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].prepareFrame(num - this.layers[i].st);\r\n }\r\n }\r\n\r\n if (this.globalData._mdf) {\r\n for (i = 0; i < len; i += 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].renderFrame();\r\n }\r\n }\r\n }\r\n };\r\n\r\n SVGRendererBase.prototype.appendElementInPos = function (element, pos) {\r\n var newElement = element.getBaseElement();\r\n\r\n if (!newElement) {\r\n return;\r\n }\r\n\r\n var i = 0;\r\n var nextElement;\r\n\r\n while (i < pos) {\r\n if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {\r\n nextElement = this.elements[i].getBaseElement();\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (nextElement) {\r\n this.layerElement.insertBefore(newElement, nextElement);\r\n } else {\r\n this.layerElement.appendChild(newElement);\r\n }\r\n };\r\n\r\n SVGRendererBase.prototype.hide = function () {\r\n this.layerElement.style.display = 'none';\r\n };\r\n\r\n SVGRendererBase.prototype.show = function () {\r\n this.layerElement.style.display = 'block';\r\n };\r\n\r\n function ICompElement() {}\r\n\r\n extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);\r\n\r\n ICompElement.prototype.initElement = function (data, globalData, comp) {\r\n this.initFrame();\r\n this.initBaseData(data, globalData, comp);\r\n this.initTransform(data, globalData, comp);\r\n this.initRenderable();\r\n this.initHierarchy();\r\n this.initRendererElement();\r\n this.createContainerElements();\r\n this.createRenderableComponents();\r\n\r\n if (this.data.xt || !globalData.progressiveLoad) {\r\n this.buildAllItems();\r\n }\r\n\r\n this.hide();\r\n };\r\n /* ICompElement.prototype.hide = function(){\r\n if(!this.hidden){\r\n this.hideElement();\r\n var i,len = this.elements.length;\r\n for( i = 0; i < len; i+=1 ){\r\n if(this.elements[i]){\r\n this.elements[i].hide();\r\n }\r\n }\r\n }\r\n }; */\r\n\r\n\r\n ICompElement.prototype.prepareFrame = function (num) {\r\n this._mdf = false;\r\n this.prepareRenderableFrame(num);\r\n this.prepareProperties(num, this.isInRange);\r\n\r\n if (!this.isInRange && !this.data.xt) {\r\n return;\r\n }\r\n\r\n if (!this.tm._placeholder) {\r\n var timeRemapped = this.tm.v;\r\n\r\n if (timeRemapped === this.data.op) {\r\n timeRemapped = this.data.op - 1;\r\n }\r\n\r\n this.renderedFrame = timeRemapped;\r\n } else {\r\n this.renderedFrame = num / this.data.sr;\r\n }\r\n\r\n var i;\r\n var len = this.elements.length;\r\n\r\n if (!this.completeLayers) {\r\n this.checkLayers(this.renderedFrame);\r\n } // This iteration needs to be backwards because of how expressions connect between each other\r\n\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);\r\n\r\n if (this.elements[i]._mdf) {\r\n this._mdf = true;\r\n }\r\n }\r\n }\r\n };\r\n\r\n ICompElement.prototype.renderInnerContent = function () {\r\n var i;\r\n var len = this.layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].renderFrame();\r\n }\r\n }\r\n };\r\n\r\n ICompElement.prototype.setElements = function (elems) {\r\n this.elements = elems;\r\n };\r\n\r\n ICompElement.prototype.getElements = function () {\r\n return this.elements;\r\n };\r\n\r\n ICompElement.prototype.destroyElements = function () {\r\n var i;\r\n var len = this.layers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.elements[i]) {\r\n this.elements[i].destroy();\r\n }\r\n }\r\n };\r\n\r\n ICompElement.prototype.destroy = function () {\r\n this.destroyElements();\r\n this.destroyBaseElement();\r\n };\r\n\r\n function SVGCompElement(data, globalData, comp) {\r\n this.layers = data.layers;\r\n this.supports3d = true;\r\n this.completeLayers = false;\r\n this.pendingElements = [];\r\n this.elements = this.layers ? createSizedArray(this.layers.length) : [];\r\n this.initElement(data, globalData, comp);\r\n this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {\r\n _placeholder: true\r\n };\r\n }\r\n\r\n extendPrototype([SVGRendererBase, ICompElement, SVGBaseElement], SVGCompElement);\r\n\r\n SVGCompElement.prototype.createComp = function (data) {\r\n return new SVGCompElement(data, this.globalData, this);\r\n };\r\n\r\n function SVGRenderer(animationItem, config) {\r\n this.animationItem = animationItem;\r\n this.layers = null;\r\n this.renderedFrame = -1;\r\n this.svgElement = createNS('svg');\r\n var ariaLabel = '';\r\n\r\n if (config && config.title) {\r\n var titleElement = createNS('title');\r\n var titleId = createElementID();\r\n titleElement.setAttribute('id', titleId);\r\n titleElement.textContent = config.title;\r\n this.svgElement.appendChild(titleElement);\r\n ariaLabel += titleId;\r\n }\r\n\r\n if (config && config.description) {\r\n var descElement = createNS('desc');\r\n var descId = createElementID();\r\n descElement.setAttribute('id', descId);\r\n descElement.textContent = config.description;\r\n this.svgElement.appendChild(descElement);\r\n ariaLabel += ' ' + descId;\r\n }\r\n\r\n if (ariaLabel) {\r\n this.svgElement.setAttribute('aria-labelledby', ariaLabel);\r\n }\r\n\r\n var defs = createNS('defs');\r\n this.svgElement.appendChild(defs);\r\n var maskElement = createNS('g');\r\n this.svgElement.appendChild(maskElement);\r\n this.layerElement = maskElement;\r\n this.renderConfig = {\r\n preserveAspectRatio: config && config.preserveAspectRatio || 'xMidYMid meet',\r\n imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',\r\n contentVisibility: config && config.contentVisibility || 'visible',\r\n progressiveLoad: config && config.progressiveLoad || false,\r\n hideOnTransparent: !(config && config.hideOnTransparent === false),\r\n viewBoxOnly: config && config.viewBoxOnly || false,\r\n viewBoxSize: config && config.viewBoxSize || false,\r\n className: config && config.className || '',\r\n id: config && config.id || '',\r\n focusable: config && config.focusable,\r\n filterSize: {\r\n width: config && config.filterSize && config.filterSize.width || '100%',\r\n height: config && config.filterSize && config.filterSize.height || '100%',\r\n x: config && config.filterSize && config.filterSize.x || '0%',\r\n y: config && config.filterSize && config.filterSize.y || '0%'\r\n },\r\n width: config && config.width,\r\n height: config && config.height,\r\n runExpressions: !config || config.runExpressions === undefined || config.runExpressions\r\n };\r\n this.globalData = {\r\n _mdf: false,\r\n frameNum: -1,\r\n defs: defs,\r\n renderConfig: this.renderConfig\r\n };\r\n this.elements = [];\r\n this.pendingElements = [];\r\n this.destroyed = false;\r\n this.rendererType = 'svg';\r\n }\r\n\r\n extendPrototype([SVGRendererBase], SVGRenderer);\r\n\r\n SVGRenderer.prototype.createComp = function (data) {\r\n return new SVGCompElement(data, this.globalData, this);\r\n };\r\n\r\n function CVContextData() {\r\n this.saved = [];\r\n this.cArrPos = 0;\r\n this.cTr = new Matrix();\r\n this.cO = 1;\r\n var i;\r\n var len = 15;\r\n this.savedOp = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.saved[i] = createTypedArray('float32', 16);\r\n }\r\n\r\n this._length = len;\r\n }\r\n\r\n CVContextData.prototype.duplicate = function () {\r\n var newLength = this._length * 2;\r\n var currentSavedOp = this.savedOp;\r\n this.savedOp = createTypedArray('float32', newLength);\r\n this.savedOp.set(currentSavedOp);\r\n var i = 0;\r\n\r\n for (i = this._length; i < newLength; i += 1) {\r\n this.saved[i] = createTypedArray('float32', 16);\r\n }\r\n\r\n this._length = newLength;\r\n };\r\n\r\n CVContextData.prototype.reset = function () {\r\n this.cArrPos = 0;\r\n this.cTr.reset();\r\n this.cO = 1;\r\n };\r\n\r\n CVContextData.prototype.popTransform = function () {\r\n var popped = this.saved[this.cArrPos];\r\n var i;\r\n var arr = this.cTr.props;\r\n\r\n for (i = 0; i < 16; i += 1) {\r\n arr[i] = popped[i];\r\n }\r\n\r\n return popped;\r\n };\r\n\r\n CVContextData.prototype.popOpacity = function () {\r\n var popped = this.savedOp[this.cArrPos];\r\n this.cO = popped;\r\n return popped;\r\n };\r\n\r\n CVContextData.prototype.pop = function () {\r\n this.cArrPos -= 1;\r\n var transform = this.popTransform();\r\n var opacity = this.popOpacity();\r\n return {\r\n transform: transform,\r\n opacity: opacity\r\n };\r\n };\r\n\r\n CVContextData.prototype.push = function () {\r\n var props = this.cTr.props;\r\n\r\n if (this._length <= this.cArrPos) {\r\n this.duplicate();\r\n }\r\n\r\n var i;\r\n var arr = this.saved[this.cArrPos];\r\n\r\n for (i = 0; i < 16; i += 1) {\r\n arr[i] = props[i];\r\n }\r\n\r\n this.savedOp[this.cArrPos] = this.cO;\r\n this.cArrPos += 1;\r\n };\r\n\r\n CVContextData.prototype.getTransform = function () {\r\n return this.cTr;\r\n };\r\n\r\n CVContextData.prototype.getOpacity = function () {\r\n return this.cO;\r\n };\r\n\r\n CVContextData.prototype.setOpacity = function (value) {\r\n this.cO = value;\r\n };\r\n\r\n function ShapeTransformManager() {\r\n this.sequences = {};\r\n this.sequenceList = [];\r\n this.transform_key_count = 0;\r\n }\r\n\r\n ShapeTransformManager.prototype = {\r\n addTransformSequence: function addTransformSequence(transforms) {\r\n var i;\r\n var len = transforms.length;\r\n var key = '_';\r\n\r\n for (i = 0; i < len; i += 1) {\r\n key += transforms[i].transform.key + '_';\r\n }\r\n\r\n var sequence = this.sequences[key];\r\n\r\n if (!sequence) {\r\n sequence = {\r\n transforms: [].concat(transforms),\r\n finalTransform: new Matrix(),\r\n _mdf: false\r\n };\r\n this.sequences[key] = sequence;\r\n this.sequenceList.push(sequence);\r\n }\r\n\r\n return sequence;\r\n },\r\n processSequence: function processSequence(sequence, isFirstFrame) {\r\n var i = 0;\r\n var len = sequence.transforms.length;\r\n var _mdf = isFirstFrame;\r\n\r\n while (i < len && !isFirstFrame) {\r\n if (sequence.transforms[i].transform.mProps._mdf) {\r\n _mdf = true;\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (_mdf) {\r\n var props;\r\n sequence.finalTransform.reset();\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n props = sequence.transforms[i].transform.mProps.v.props;\r\n sequence.finalTransform.transform(props[0], props[1], props[2], props[3], props[4], props[5], props[6], props[7], props[8], props[9], props[10], props[11], props[12], props[13], props[14], props[15]);\r\n }\r\n }\r\n\r\n sequence._mdf = _mdf;\r\n },\r\n processSequences: function processSequences(isFirstFrame) {\r\n var i;\r\n var len = this.sequenceList.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.processSequence(this.sequenceList[i], isFirstFrame);\r\n }\r\n },\r\n getNewKey: function getNewKey() {\r\n this.transform_key_count += 1;\r\n return '_' + this.transform_key_count;\r\n }\r\n };\r\n\r\n var lumaLoader = function lumaLoader() {\r\n var id = '__lottie_element_luma_buffer';\r\n var lumaBuffer = null;\r\n var lumaBufferCtx = null;\r\n var svg = null; // This alternate solution has a slight delay before the filter is applied, resulting in a flicker on the first frame.\r\n // Keeping this here for reference, and in the future, if offscreen canvas supports url filters, this can be used.\r\n // For now, neither of them work for offscreen canvas, so canvas workers can't support the luma track matte mask.\r\n // Naming it solution 2 to mark the extra comment lines.\r\n\r\n /*\r\n var svgString = [\r\n '',\r\n '',\r\n '',\r\n '',\r\n '',\r\n ].join('');\r\n var blob = new Blob([svgString], { type: 'image/svg+xml' });\r\n var url = URL.createObjectURL(blob);\r\n */\r\n\r\n function createLumaSvgFilter() {\r\n var _svg = createNS('svg');\r\n\r\n var fil = createNS('filter');\r\n var matrix = createNS('feColorMatrix');\r\n fil.setAttribute('id', id);\r\n matrix.setAttribute('type', 'matrix');\r\n matrix.setAttribute('color-interpolation-filters', 'sRGB');\r\n matrix.setAttribute('values', '0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0');\r\n fil.appendChild(matrix);\r\n\r\n _svg.appendChild(fil);\r\n\r\n _svg.setAttribute('id', id + '_svg');\r\n\r\n if (featureSupport.svgLumaHidden) {\r\n _svg.style.display = 'none';\r\n }\r\n\r\n return _svg;\r\n }\r\n\r\n function loadLuma() {\r\n if (!lumaBuffer) {\r\n svg = createLumaSvgFilter();\r\n document.body.appendChild(svg);\r\n lumaBuffer = createTag('canvas');\r\n lumaBufferCtx = lumaBuffer.getContext('2d'); // lumaBufferCtx.filter = `url('${url}#__lottie_element_luma_buffer')`; // part of solution 2\r\n\r\n lumaBufferCtx.filter = 'url(#' + id + ')';\r\n lumaBufferCtx.fillStyle = 'rgba(0,0,0,0)';\r\n lumaBufferCtx.fillRect(0, 0, 1, 1);\r\n }\r\n }\r\n\r\n function getLuma(canvas) {\r\n if (!lumaBuffer) {\r\n loadLuma();\r\n }\r\n\r\n lumaBuffer.width = canvas.width;\r\n lumaBuffer.height = canvas.height; // lumaBufferCtx.filter = `url('${url}#__lottie_element_luma_buffer')`; // part of solution 2\r\n\r\n lumaBufferCtx.filter = 'url(#' + id + ')';\r\n return lumaBuffer;\r\n }\r\n\r\n return {\r\n load: loadLuma,\r\n get: getLuma\r\n };\r\n };\r\n\r\n function createCanvas(width, height) {\r\n if (featureSupport.offscreenCanvas) {\r\n return new OffscreenCanvas(width, height);\r\n }\r\n\r\n var canvas = createTag('canvas');\r\n canvas.width = width;\r\n canvas.height = height;\r\n return canvas;\r\n }\r\n\r\n var assetLoader = function () {\r\n return {\r\n loadLumaCanvas: lumaLoader.load,\r\n getLumaCanvas: lumaLoader.get,\r\n createCanvas: createCanvas\r\n };\r\n }();\r\n\r\n function CVEffects() {}\r\n\r\n CVEffects.prototype.renderFrame = function () {};\r\n\r\n function CVMaskElement(data, element) {\r\n this.data = data;\r\n this.element = element;\r\n this.masksProperties = this.data.masksProperties || [];\r\n this.viewData = createSizedArray(this.masksProperties.length);\r\n var i;\r\n var len = this.masksProperties.length;\r\n var hasMasks = false;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.masksProperties[i].mode !== 'n') {\r\n hasMasks = true;\r\n }\r\n\r\n this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);\r\n }\r\n\r\n this.hasMasks = hasMasks;\r\n\r\n if (hasMasks) {\r\n this.element.addRenderableComponent(this);\r\n }\r\n }\r\n\r\n CVMaskElement.prototype.renderFrame = function () {\r\n if (!this.hasMasks) {\r\n return;\r\n }\r\n\r\n var transform = this.element.finalTransform.mat;\r\n var ctx = this.element.canvasContext;\r\n var i;\r\n var len = this.masksProperties.length;\r\n var pt;\r\n var pts;\r\n var data;\r\n ctx.beginPath();\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.masksProperties[i].mode !== 'n') {\r\n if (this.masksProperties[i].inv) {\r\n ctx.moveTo(0, 0);\r\n ctx.lineTo(this.element.globalData.compSize.w, 0);\r\n ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);\r\n ctx.lineTo(0, this.element.globalData.compSize.h);\r\n ctx.lineTo(0, 0);\r\n }\r\n\r\n data = this.viewData[i].v;\r\n pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);\r\n ctx.moveTo(pt[0], pt[1]);\r\n var j;\r\n var jLen = data._length;\r\n\r\n for (j = 1; j < jLen; j += 1) {\r\n pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);\r\n ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);\r\n }\r\n\r\n pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);\r\n ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);\r\n }\r\n }\r\n\r\n this.element.globalData.renderer.save(true);\r\n ctx.clip();\r\n };\r\n\r\n CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;\r\n\r\n CVMaskElement.prototype.destroy = function () {\r\n this.element = null;\r\n };\r\n\r\n function CVBaseElement() {}\r\n\r\n var operationsMap = {\r\n 1: 'source-in',\r\n 2: 'source-out',\r\n 3: 'source-in',\r\n 4: 'source-out'\r\n };\r\n CVBaseElement.prototype = {\r\n createElements: function createElements() {},\r\n initRendererElement: function initRendererElement() {},\r\n createContainerElements: function createContainerElements() {\r\n // If the layer is masked we will use two buffers to store each different states of the drawing\r\n // This solution is not ideal for several reason. But unfortunately, because of the recursive\r\n // nature of the render tree, it's the only simple way to make sure one inner mask doesn't override an outer mask.\r\n // TODO: try to reduce the size of these buffers to the size of the composition contaning the layer\r\n // It might be challenging because the layer most likely is transformed in some way\r\n if (this.data.tt >= 1) {\r\n this.buffers = [];\r\n var canvasContext = this.globalData.canvasContext;\r\n var bufferCanvas = assetLoader.createCanvas(canvasContext.canvas.width, canvasContext.canvas.height);\r\n this.buffers.push(bufferCanvas);\r\n var bufferCanvas2 = assetLoader.createCanvas(canvasContext.canvas.width, canvasContext.canvas.height);\r\n this.buffers.push(bufferCanvas2);\r\n\r\n if (this.data.tt >= 3 && !document._isProxy) {\r\n assetLoader.loadLumaCanvas();\r\n }\r\n }\r\n\r\n this.canvasContext = this.globalData.canvasContext;\r\n this.transformCanvas = this.globalData.transformCanvas;\r\n this.renderableEffectsManager = new CVEffects(this);\r\n },\r\n createContent: function createContent() {},\r\n setBlendMode: function setBlendMode() {\r\n var globalData = this.globalData;\r\n\r\n if (globalData.blendMode !== this.data.bm) {\r\n globalData.blendMode = this.data.bm;\r\n var blendModeValue = getBlendMode(this.data.bm);\r\n globalData.canvasContext.globalCompositeOperation = blendModeValue;\r\n }\r\n },\r\n createRenderableComponents: function createRenderableComponents() {\r\n this.maskManager = new CVMaskElement(this.data, this);\r\n },\r\n hideElement: function hideElement() {\r\n if (!this.hidden && (!this.isInRange || this.isTransparent)) {\r\n this.hidden = true;\r\n }\r\n },\r\n showElement: function showElement() {\r\n if (this.isInRange && !this.isTransparent) {\r\n this.hidden = false;\r\n this._isFirstFrame = true;\r\n this.maskManager._isFirstFrame = true;\r\n }\r\n },\r\n clearCanvas: function clearCanvas(canvasContext) {\r\n canvasContext.clearRect(this.transformCanvas.tx, this.transformCanvas.ty, this.transformCanvas.w * this.transformCanvas.sx, this.transformCanvas.h * this.transformCanvas.sy);\r\n },\r\n prepareLayer: function prepareLayer() {\r\n if (this.data.tt >= 1) {\r\n var buffer = this.buffers[0];\r\n var bufferCtx = buffer.getContext('2d');\r\n this.clearCanvas(bufferCtx); // on the first buffer we store the current state of the global drawing\r\n\r\n bufferCtx.drawImage(this.canvasContext.canvas, 0, 0); // The next four lines are to clear the canvas\r\n // TODO: Check if there is a way to clear the canvas without resetting the transform\r\n\r\n this.currentTransform = this.canvasContext.getTransform();\r\n this.canvasContext.setTransform(1, 0, 0, 1, 0, 0);\r\n this.clearCanvas(this.canvasContext);\r\n this.canvasContext.setTransform(this.currentTransform);\r\n }\r\n },\r\n exitLayer: function exitLayer() {\r\n if (this.data.tt >= 1) {\r\n var buffer = this.buffers[1]; // On the second buffer we store the current state of the global drawing\r\n // that only contains the content of this layer\r\n // (if it is a composition, it also includes the nested layers)\r\n\r\n var bufferCtx = buffer.getContext('2d');\r\n this.clearCanvas(bufferCtx);\r\n bufferCtx.drawImage(this.canvasContext.canvas, 0, 0); // We clear the canvas again\r\n\r\n this.canvasContext.setTransform(1, 0, 0, 1, 0, 0);\r\n this.clearCanvas(this.canvasContext);\r\n this.canvasContext.setTransform(this.currentTransform); // We draw the mask\r\n\r\n var mask = this.comp.getElementById('tp' in this.data ? this.data.tp : this.data.ind - 1);\r\n mask.renderFrame(true); // We draw the second buffer (that contains the content of this layer)\r\n\r\n this.canvasContext.setTransform(1, 0, 0, 1, 0, 0); // If the mask is a Luma matte, we need to do two extra painting operations\r\n // the _isProxy check is to avoid drawing a fake canvas in workers that will throw an error\r\n\r\n if (this.data.tt >= 3 && !document._isProxy) {\r\n // We copy the painted mask to a buffer that has a color matrix filter applied to it\r\n // that applies the rgb values to the alpha channel\r\n var lumaBuffer = assetLoader.getLumaCanvas(this.canvasContext.canvas);\r\n var lumaBufferCtx = lumaBuffer.getContext('2d');\r\n lumaBufferCtx.drawImage(this.canvasContext.canvas, 0, 0);\r\n this.clearCanvas(this.canvasContext); // we repaint the context with the mask applied to it\r\n\r\n this.canvasContext.drawImage(lumaBuffer, 0, 0);\r\n }\r\n\r\n this.canvasContext.globalCompositeOperation = operationsMap[this.data.tt];\r\n this.canvasContext.drawImage(buffer, 0, 0); // We finally draw the first buffer (that contains the content of the global drawing)\r\n // We use destination-over to draw the global drawing below the current layer\r\n\r\n this.canvasContext.globalCompositeOperation = 'destination-over';\r\n this.canvasContext.drawImage(this.buffers[0], 0, 0);\r\n this.canvasContext.setTransform(this.currentTransform); // We reset the globalCompositeOperation to source-over, the standard type of operation\r\n\r\n this.canvasContext.globalCompositeOperation = 'source-over';\r\n }\r\n },\r\n renderFrame: function renderFrame(forceRender) {\r\n if (this.hidden || this.data.hd) {\r\n return;\r\n }\r\n\r\n if (this.data.td === 1 && !forceRender) {\r\n return;\r\n }\r\n\r\n this.renderTransform();\r\n this.renderRenderable();\r\n this.setBlendMode();\r\n var forceRealStack = this.data.ty === 0;\r\n this.prepareLayer();\r\n this.globalData.renderer.save(forceRealStack);\r\n this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);\r\n this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);\r\n this.renderInnerContent();\r\n this.globalData.renderer.restore(forceRealStack);\r\n this.exitLayer();\r\n\r\n if (this.maskManager.hasMasks) {\r\n this.globalData.renderer.restore(true);\r\n }\r\n\r\n if (this._isFirstFrame) {\r\n this._isFirstFrame = false;\r\n }\r\n },\r\n destroy: function destroy() {\r\n this.canvasContext = null;\r\n this.data = null;\r\n this.globalData = null;\r\n this.maskManager.destroy();\r\n },\r\n mHelper: new Matrix()\r\n };\r\n CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;\r\n CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;\r\n\r\n function CVShapeData(element, data, styles, transformsManager) {\r\n this.styledShapes = [];\r\n this.tr = [0, 0, 0, 0, 0, 0];\r\n var ty = 4;\r\n\r\n if (data.ty === 'rc') {\r\n ty = 5;\r\n } else if (data.ty === 'el') {\r\n ty = 6;\r\n } else if (data.ty === 'sr') {\r\n ty = 7;\r\n }\r\n\r\n this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);\r\n var i;\r\n var len = styles.length;\r\n var styledShape;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!styles[i].closed) {\r\n styledShape = {\r\n transforms: transformsManager.addTransformSequence(styles[i].transforms),\r\n trNodes: []\r\n };\r\n this.styledShapes.push(styledShape);\r\n styles[i].elements.push(styledShape);\r\n }\r\n }\r\n }\r\n\r\n CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;\r\n\r\n function CVShapeElement(data, globalData, comp) {\r\n this.shapes = [];\r\n this.shapesData = data.shapes;\r\n this.stylesList = [];\r\n this.itemsData = [];\r\n this.prevViewData = [];\r\n this.shapeModifiers = [];\r\n this.processedElements = [];\r\n this.transformsManager = new ShapeTransformManager();\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);\r\n CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;\r\n CVShapeElement.prototype.transformHelper = {\r\n opacity: 1,\r\n _opMdf: false\r\n };\r\n CVShapeElement.prototype.dashResetter = [];\r\n\r\n CVShapeElement.prototype.createContent = function () {\r\n this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);\r\n };\r\n\r\n CVShapeElement.prototype.createStyleElement = function (data, transforms) {\r\n var styleElem = {\r\n data: data,\r\n type: data.ty,\r\n preTransforms: this.transformsManager.addTransformSequence(transforms),\r\n transforms: [],\r\n elements: [],\r\n closed: data.hd === true\r\n };\r\n var elementData = {};\r\n\r\n if (data.ty === 'fl' || data.ty === 'st') {\r\n elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);\r\n\r\n if (!elementData.c.k) {\r\n styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')';\r\n }\r\n } else if (data.ty === 'gf' || data.ty === 'gs') {\r\n elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);\r\n elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);\r\n elementData.h = PropertyFactory.getProp(this, data.h || {\r\n k: 0\r\n }, 0, 0.01, this);\r\n elementData.a = PropertyFactory.getProp(this, data.a || {\r\n k: 0\r\n }, 0, degToRads, this);\r\n elementData.g = new GradientProperty(this, data.g, this);\r\n }\r\n\r\n elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);\r\n\r\n if (data.ty === 'st' || data.ty === 'gs') {\r\n styleElem.lc = lineCapEnum[data.lc || 2];\r\n styleElem.lj = lineJoinEnum[data.lj || 2];\r\n\r\n if (data.lj == 1) {\r\n // eslint-disable-line eqeqeq\r\n styleElem.ml = data.ml;\r\n }\r\n\r\n elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);\r\n\r\n if (!elementData.w.k) {\r\n styleElem.wi = elementData.w.v;\r\n }\r\n\r\n if (data.d) {\r\n var d = new DashProperty(this, data.d, 'canvas', this);\r\n elementData.d = d;\r\n\r\n if (!elementData.d.k) {\r\n styleElem.da = elementData.d.dashArray;\r\n styleElem[\"do\"] = elementData.d.dashoffset[0];\r\n }\r\n }\r\n } else {\r\n styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';\r\n }\r\n\r\n this.stylesList.push(styleElem);\r\n elementData.style = styleElem;\r\n return elementData;\r\n };\r\n\r\n CVShapeElement.prototype.createGroupElement = function () {\r\n var elementData = {\r\n it: [],\r\n prevViewData: []\r\n };\r\n return elementData;\r\n };\r\n\r\n CVShapeElement.prototype.createTransformElement = function (data) {\r\n var elementData = {\r\n transform: {\r\n opacity: 1,\r\n _opMdf: false,\r\n key: this.transformsManager.getNewKey(),\r\n op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),\r\n mProps: TransformPropertyFactory.getTransformProperty(this, data, this)\r\n }\r\n };\r\n return elementData;\r\n };\r\n\r\n CVShapeElement.prototype.createShapeElement = function (data) {\r\n var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);\r\n this.shapes.push(elementData);\r\n this.addShapeToModifiers(elementData);\r\n return elementData;\r\n };\r\n\r\n CVShapeElement.prototype.reloadShapes = function () {\r\n this._isFirstFrame = true;\r\n var i;\r\n var len = this.itemsData.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.prevViewData[i] = this.itemsData[i];\r\n }\r\n\r\n this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);\r\n len = this.dynamicProperties.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.dynamicProperties[i].getValue();\r\n }\r\n\r\n this.renderModifiers();\r\n this.transformsManager.processSequences(this._isFirstFrame);\r\n };\r\n\r\n CVShapeElement.prototype.addTransformToStyleList = function (transform) {\r\n var i;\r\n var len = this.stylesList.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!this.stylesList[i].closed) {\r\n this.stylesList[i].transforms.push(transform);\r\n }\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.removeTransformFromStyleList = function () {\r\n var i;\r\n var len = this.stylesList.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!this.stylesList[i].closed) {\r\n this.stylesList[i].transforms.pop();\r\n }\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.closeStyles = function (styles) {\r\n var i;\r\n var len = styles.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n styles[i].closed = true;\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {\r\n var i;\r\n var len = arr.length - 1;\r\n var j;\r\n var jLen;\r\n var ownStyles = [];\r\n var ownModifiers = [];\r\n var processedPos;\r\n var modifier;\r\n var currentTransform;\r\n var ownTransforms = [].concat(transforms);\r\n\r\n for (i = len; i >= 0; i -= 1) {\r\n processedPos = this.searchProcessedElement(arr[i]);\r\n\r\n if (!processedPos) {\r\n arr[i]._shouldRender = shouldRender;\r\n } else {\r\n itemsData[i] = prevViewData[processedPos - 1];\r\n }\r\n\r\n if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createStyleElement(arr[i], ownTransforms);\r\n } else {\r\n itemsData[i].style.closed = false;\r\n }\r\n\r\n ownStyles.push(itemsData[i].style);\r\n } else if (arr[i].ty === 'gr') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createGroupElement(arr[i]);\r\n } else {\r\n jLen = itemsData[i].it.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n itemsData[i].prevViewData[j] = itemsData[i].it[j];\r\n }\r\n }\r\n\r\n this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);\r\n } else if (arr[i].ty === 'tr') {\r\n if (!processedPos) {\r\n currentTransform = this.createTransformElement(arr[i]);\r\n itemsData[i] = currentTransform;\r\n }\r\n\r\n ownTransforms.push(itemsData[i]);\r\n this.addTransformToStyleList(itemsData[i]);\r\n } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {\r\n if (!processedPos) {\r\n itemsData[i] = this.createShapeElement(arr[i]);\r\n }\r\n } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') {\r\n if (!processedPos) {\r\n modifier = ShapeModifiers.getModifier(arr[i].ty);\r\n modifier.init(this, arr[i]);\r\n itemsData[i] = modifier;\r\n this.shapeModifiers.push(modifier);\r\n } else {\r\n modifier = itemsData[i];\r\n modifier.closed = false;\r\n }\r\n\r\n ownModifiers.push(modifier);\r\n } else if (arr[i].ty === 'rp') {\r\n if (!processedPos) {\r\n modifier = ShapeModifiers.getModifier(arr[i].ty);\r\n itemsData[i] = modifier;\r\n modifier.init(this, arr, i, itemsData);\r\n this.shapeModifiers.push(modifier);\r\n shouldRender = false;\r\n } else {\r\n modifier = itemsData[i];\r\n modifier.closed = true;\r\n }\r\n\r\n ownModifiers.push(modifier);\r\n }\r\n\r\n this.addProcessedElement(arr[i], i + 1);\r\n }\r\n\r\n this.removeTransformFromStyleList();\r\n this.closeStyles(ownStyles);\r\n len = ownModifiers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ownModifiers[i].closed = true;\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.renderInnerContent = function () {\r\n this.transformHelper.opacity = 1;\r\n this.transformHelper._opMdf = false;\r\n this.renderModifiers();\r\n this.transformsManager.processSequences(this._isFirstFrame);\r\n this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);\r\n };\r\n\r\n CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {\r\n if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {\r\n groupTransform.opacity = parentTransform.opacity;\r\n groupTransform.opacity *= groupTransform.op.v;\r\n groupTransform._opMdf = true;\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.drawLayer = function () {\r\n var i;\r\n var len = this.stylesList.length;\r\n var j;\r\n var jLen;\r\n var k;\r\n var kLen;\r\n var elems;\r\n var nodes;\r\n var renderer = this.globalData.renderer;\r\n var ctx = this.globalData.canvasContext;\r\n var type;\r\n var currentStyle;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n currentStyle = this.stylesList[i];\r\n type = currentStyle.type; // Skipping style when\r\n // Stroke width equals 0\r\n // style should not be rendered (extra unused repeaters)\r\n // current opacity equals 0\r\n // global opacity equals 0\r\n\r\n if (!((type === 'st' || type === 'gs') && currentStyle.wi === 0 || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) {\r\n renderer.save();\r\n elems = currentStyle.elements;\r\n\r\n if (type === 'st' || type === 'gs') {\r\n ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;\r\n ctx.lineWidth = currentStyle.wi;\r\n ctx.lineCap = currentStyle.lc;\r\n ctx.lineJoin = currentStyle.lj;\r\n ctx.miterLimit = currentStyle.ml || 0;\r\n } else {\r\n ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;\r\n }\r\n\r\n renderer.ctxOpacity(currentStyle.coOp);\r\n\r\n if (type !== 'st' && type !== 'gs') {\r\n ctx.beginPath();\r\n }\r\n\r\n renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);\r\n jLen = elems.length;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (type === 'st' || type === 'gs') {\r\n ctx.beginPath();\r\n\r\n if (currentStyle.da) {\r\n ctx.setLineDash(currentStyle.da);\r\n ctx.lineDashOffset = currentStyle[\"do\"];\r\n }\r\n }\r\n\r\n nodes = elems[j].trNodes;\r\n kLen = nodes.length;\r\n\r\n for (k = 0; k < kLen; k += 1) {\r\n if (nodes[k].t === 'm') {\r\n ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);\r\n } else if (nodes[k].t === 'c') {\r\n ctx.bezierCurveTo(nodes[k].pts[0], nodes[k].pts[1], nodes[k].pts[2], nodes[k].pts[3], nodes[k].pts[4], nodes[k].pts[5]);\r\n } else {\r\n ctx.closePath();\r\n }\r\n }\r\n\r\n if (type === 'st' || type === 'gs') {\r\n ctx.stroke();\r\n\r\n if (currentStyle.da) {\r\n ctx.setLineDash(this.dashResetter);\r\n }\r\n }\r\n }\r\n\r\n if (type !== 'st' && type !== 'gs') {\r\n ctx.fill(currentStyle.r);\r\n }\r\n\r\n renderer.restore();\r\n }\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {\r\n var i;\r\n var len = items.length - 1;\r\n var groupTransform;\r\n groupTransform = parentTransform;\r\n\r\n for (i = len; i >= 0; i -= 1) {\r\n if (items[i].ty === 'tr') {\r\n groupTransform = data[i].transform;\r\n this.renderShapeTransform(parentTransform, groupTransform);\r\n } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') {\r\n this.renderPath(items[i], data[i]);\r\n } else if (items[i].ty === 'fl') {\r\n this.renderFill(items[i], data[i], groupTransform);\r\n } else if (items[i].ty === 'st') {\r\n this.renderStroke(items[i], data[i], groupTransform);\r\n } else if (items[i].ty === 'gf' || items[i].ty === 'gs') {\r\n this.renderGradientFill(items[i], data[i], groupTransform);\r\n } else if (items[i].ty === 'gr') {\r\n this.renderShape(groupTransform, items[i].it, data[i].it);\r\n } else if (items[i].ty === 'tm') {//\r\n }\r\n }\r\n\r\n if (isMain) {\r\n this.drawLayer();\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {\r\n if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {\r\n var shapeNodes = styledShape.trNodes;\r\n var paths = shape.paths;\r\n var i;\r\n var len;\r\n var j;\r\n var jLen = paths._length;\r\n shapeNodes.length = 0;\r\n var groupTransformMat = styledShape.transforms.finalTransform;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n var pathNodes = paths.shapes[j];\r\n\r\n if (pathNodes && pathNodes.v) {\r\n len = pathNodes._length;\r\n\r\n for (i = 1; i < len; i += 1) {\r\n if (i === 1) {\r\n shapeNodes.push({\r\n t: 'm',\r\n p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)\r\n });\r\n }\r\n\r\n shapeNodes.push({\r\n t: 'c',\r\n pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])\r\n });\r\n }\r\n\r\n if (len === 1) {\r\n shapeNodes.push({\r\n t: 'm',\r\n p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)\r\n });\r\n }\r\n\r\n if (pathNodes.c && len) {\r\n shapeNodes.push({\r\n t: 'c',\r\n pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])\r\n });\r\n shapeNodes.push({\r\n t: 'z'\r\n });\r\n }\r\n }\r\n }\r\n\r\n styledShape.trNodes = shapeNodes;\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.renderPath = function (pathData, itemData) {\r\n if (pathData.hd !== true && pathData._shouldRender) {\r\n var i;\r\n var len = itemData.styledShapes.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.renderStyledShape(itemData.styledShapes[i], itemData.sh);\r\n }\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {\r\n var styleElem = itemData.style;\r\n\r\n if (itemData.c._mdf || this._isFirstFrame) {\r\n styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';\r\n }\r\n\r\n if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {\r\n styleElem.coOp = itemData.o.v * groupTransform.opacity;\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {\r\n var styleElem = itemData.style;\r\n var grd;\r\n\r\n if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf)) {\r\n var ctx = this.globalData.canvasContext;\r\n var pt1 = itemData.s.v;\r\n var pt2 = itemData.e.v;\r\n\r\n if (styleData.t === 1) {\r\n grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);\r\n } else {\r\n var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));\r\n var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);\r\n var percent = itemData.h.v;\r\n\r\n if (percent >= 1) {\r\n percent = 0.99;\r\n } else if (percent <= -1) {\r\n percent = -0.99;\r\n }\r\n\r\n var dist = rad * percent;\r\n var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];\r\n var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];\r\n grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);\r\n }\r\n\r\n var i;\r\n var len = styleData.g.p;\r\n var cValues = itemData.g.c;\r\n var opacity = 1;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (itemData.g._hasOpacity && itemData.g._collapsable) {\r\n opacity = itemData.g.o[i * 2 + 1];\r\n }\r\n\r\n grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');\r\n }\r\n\r\n styleElem.grd = grd;\r\n }\r\n\r\n styleElem.coOp = itemData.o.v * groupTransform.opacity;\r\n };\r\n\r\n CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {\r\n var styleElem = itemData.style;\r\n var d = itemData.d;\r\n\r\n if (d && (d._mdf || this._isFirstFrame)) {\r\n styleElem.da = d.dashArray;\r\n styleElem[\"do\"] = d.dashoffset[0];\r\n }\r\n\r\n if (itemData.c._mdf || this._isFirstFrame) {\r\n styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';\r\n }\r\n\r\n if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {\r\n styleElem.coOp = itemData.o.v * groupTransform.opacity;\r\n }\r\n\r\n if (itemData.w._mdf || this._isFirstFrame) {\r\n styleElem.wi = itemData.w.v;\r\n }\r\n };\r\n\r\n CVShapeElement.prototype.destroy = function () {\r\n this.shapesData = null;\r\n this.globalData = null;\r\n this.canvasContext = null;\r\n this.stylesList.length = 0;\r\n this.itemsData.length = 0;\r\n };\r\n\r\n function CVTextElement(data, globalData, comp) {\r\n this.textSpans = [];\r\n this.yOffset = 0;\r\n this.fillColorAnim = false;\r\n this.strokeColorAnim = false;\r\n this.strokeWidthAnim = false;\r\n this.stroke = false;\r\n this.fill = false;\r\n this.justifyOffset = 0;\r\n this.currentRender = null;\r\n this.renderType = 'canvas';\r\n this.values = {\r\n fill: 'rgba(0,0,0,0)',\r\n stroke: 'rgba(0,0,0,0)',\r\n sWidth: 0,\r\n fValue: ''\r\n };\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement);\r\n CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');\r\n\r\n CVTextElement.prototype.buildNewText = function () {\r\n var documentData = this.textProperty.currentData;\r\n this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);\r\n var hasFill = false;\r\n\r\n if (documentData.fc) {\r\n hasFill = true;\r\n this.values.fill = this.buildColor(documentData.fc);\r\n } else {\r\n this.values.fill = 'rgba(0,0,0,0)';\r\n }\r\n\r\n this.fill = hasFill;\r\n var hasStroke = false;\r\n\r\n if (documentData.sc) {\r\n hasStroke = true;\r\n this.values.stroke = this.buildColor(documentData.sc);\r\n this.values.sWidth = documentData.sw;\r\n }\r\n\r\n var fontData = this.globalData.fontManager.getFontByName(documentData.f);\r\n var i;\r\n var len;\r\n var letters = documentData.l;\r\n var matrixHelper = this.mHelper;\r\n this.stroke = hasStroke;\r\n this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily;\r\n len = documentData.finalText.length; // this.tHelper.font = this.values.fValue;\r\n\r\n var charData;\r\n var shapeData;\r\n var k;\r\n var kLen;\r\n var shapes;\r\n var j;\r\n var jLen;\r\n var pathNodes;\r\n var commands;\r\n var pathArr;\r\n var singleShape = this.data.singleShape;\r\n var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;\r\n var xPos = 0;\r\n var yPos = 0;\r\n var firstLine = true;\r\n var cnt = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);\r\n shapeData = charData && charData.data || {};\r\n matrixHelper.reset();\r\n\r\n if (singleShape && letters[i].n) {\r\n xPos = -trackingOffset;\r\n yPos += documentData.yOffset;\r\n yPos += firstLine ? 1 : 0;\r\n firstLine = false;\r\n }\r\n\r\n shapes = shapeData.shapes ? shapeData.shapes[0].it : [];\r\n jLen = shapes.length;\r\n matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);\r\n\r\n if (singleShape) {\r\n this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);\r\n }\r\n\r\n commands = createSizedArray(jLen - 1);\r\n var commandsCounter = 0;\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n if (shapes[j].ty === 'sh') {\r\n kLen = shapes[j].ks.k.i.length;\r\n pathNodes = shapes[j].ks.k;\r\n pathArr = [];\r\n\r\n for (k = 1; k < kLen; k += 1) {\r\n if (k === 1) {\r\n pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));\r\n }\r\n\r\n pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToY(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToX(pathNodes.v[k][0], pathNodes.v[k][1], 0), matrixHelper.applyToY(pathNodes.v[k][0], pathNodes.v[k][1], 0));\r\n }\r\n\r\n pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToY(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));\r\n commands[commandsCounter] = pathArr;\r\n commandsCounter += 1;\r\n }\r\n }\r\n\r\n if (singleShape) {\r\n xPos += letters[i].l;\r\n xPos += trackingOffset;\r\n }\r\n\r\n if (this.textSpans[cnt]) {\r\n this.textSpans[cnt].elem = commands;\r\n } else {\r\n this.textSpans[cnt] = {\r\n elem: commands\r\n };\r\n }\r\n\r\n cnt += 1;\r\n }\r\n };\r\n\r\n CVTextElement.prototype.renderInnerContent = function () {\r\n var ctx = this.canvasContext;\r\n ctx.font = this.values.fValue;\r\n ctx.lineCap = 'butt';\r\n ctx.lineJoin = 'miter';\r\n ctx.miterLimit = 4;\r\n\r\n if (!this.data.singleShape) {\r\n this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);\r\n }\r\n\r\n var i;\r\n var len;\r\n var j;\r\n var jLen;\r\n var k;\r\n var kLen;\r\n var renderedLetters = this.textAnimator.renderedLetters;\r\n var letters = this.textProperty.currentData.l;\r\n len = letters.length;\r\n var renderedLetter;\r\n var lastFill = null;\r\n var lastStroke = null;\r\n var lastStrokeW = null;\r\n var commands;\r\n var pathArr;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (!letters[i].n) {\r\n renderedLetter = renderedLetters[i];\r\n\r\n if (renderedLetter) {\r\n this.globalData.renderer.save();\r\n this.globalData.renderer.ctxTransform(renderedLetter.p);\r\n this.globalData.renderer.ctxOpacity(renderedLetter.o);\r\n }\r\n\r\n if (this.fill) {\r\n if (renderedLetter && renderedLetter.fc) {\r\n if (lastFill !== renderedLetter.fc) {\r\n lastFill = renderedLetter.fc;\r\n ctx.fillStyle = renderedLetter.fc;\r\n }\r\n } else if (lastFill !== this.values.fill) {\r\n lastFill = this.values.fill;\r\n ctx.fillStyle = this.values.fill;\r\n }\r\n\r\n commands = this.textSpans[i].elem;\r\n jLen = commands.length;\r\n this.globalData.canvasContext.beginPath();\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n pathArr = commands[j];\r\n kLen = pathArr.length;\r\n this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);\r\n\r\n for (k = 2; k < kLen; k += 6) {\r\n this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);\r\n }\r\n }\r\n\r\n this.globalData.canvasContext.closePath();\r\n this.globalData.canvasContext.fill(); /// ctx.fillText(this.textSpans[i].val,0,0);\r\n }\r\n\r\n if (this.stroke) {\r\n if (renderedLetter && renderedLetter.sw) {\r\n if (lastStrokeW !== renderedLetter.sw) {\r\n lastStrokeW = renderedLetter.sw;\r\n ctx.lineWidth = renderedLetter.sw;\r\n }\r\n } else if (lastStrokeW !== this.values.sWidth) {\r\n lastStrokeW = this.values.sWidth;\r\n ctx.lineWidth = this.values.sWidth;\r\n }\r\n\r\n if (renderedLetter && renderedLetter.sc) {\r\n if (lastStroke !== renderedLetter.sc) {\r\n lastStroke = renderedLetter.sc;\r\n ctx.strokeStyle = renderedLetter.sc;\r\n }\r\n } else if (lastStroke !== this.values.stroke) {\r\n lastStroke = this.values.stroke;\r\n ctx.strokeStyle = this.values.stroke;\r\n }\r\n\r\n commands = this.textSpans[i].elem;\r\n jLen = commands.length;\r\n this.globalData.canvasContext.beginPath();\r\n\r\n for (j = 0; j < jLen; j += 1) {\r\n pathArr = commands[j];\r\n kLen = pathArr.length;\r\n this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);\r\n\r\n for (k = 2; k < kLen; k += 6) {\r\n this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);\r\n }\r\n }\r\n\r\n this.globalData.canvasContext.closePath();\r\n this.globalData.canvasContext.stroke(); /// ctx.strokeText(letters[i].val,0,0);\r\n }\r\n\r\n if (renderedLetter) {\r\n this.globalData.renderer.restore();\r\n }\r\n }\r\n }\r\n };\r\n\r\n function CVImageElement(data, globalData, comp) {\r\n this.assetData = globalData.getAssetData(data.refId);\r\n this.img = globalData.imageLoader.getAsset(this.assetData);\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);\r\n CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;\r\n CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;\r\n\r\n CVImageElement.prototype.createContent = function () {\r\n if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {\r\n var canvas = createTag('canvas');\r\n canvas.width = this.assetData.w;\r\n canvas.height = this.assetData.h;\r\n var ctx = canvas.getContext('2d');\r\n var imgW = this.img.width;\r\n var imgH = this.img.height;\r\n var imgRel = imgW / imgH;\r\n var canvasRel = this.assetData.w / this.assetData.h;\r\n var widthCrop;\r\n var heightCrop;\r\n var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;\r\n\r\n if (imgRel > canvasRel && par === 'xMidYMid slice' || imgRel < canvasRel && par !== 'xMidYMid slice') {\r\n heightCrop = imgH;\r\n widthCrop = heightCrop * canvasRel;\r\n } else {\r\n widthCrop = imgW;\r\n heightCrop = widthCrop / canvasRel;\r\n }\r\n\r\n ctx.drawImage(this.img, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h);\r\n this.img = canvas;\r\n }\r\n };\r\n\r\n CVImageElement.prototype.renderInnerContent = function () {\r\n this.canvasContext.drawImage(this.img, 0, 0);\r\n };\r\n\r\n CVImageElement.prototype.destroy = function () {\r\n this.img = null;\r\n };\r\n\r\n function CVSolidElement(data, globalData, comp) {\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);\r\n CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;\r\n CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;\r\n\r\n CVSolidElement.prototype.renderInnerContent = function () {\r\n var ctx = this.canvasContext;\r\n ctx.fillStyle = this.data.sc;\r\n ctx.fillRect(0, 0, this.data.sw, this.data.sh); //\r\n };\r\n\r\n function CanvasRendererBase(animationItem, config) {\r\n this.animationItem = animationItem;\r\n this.renderConfig = {\r\n clearCanvas: config && config.clearCanvas !== undefined ? config.clearCanvas : true,\r\n context: config && config.context || null,\r\n progressiveLoad: config && config.progressiveLoad || false,\r\n preserveAspectRatio: config && config.preserveAspectRatio || 'xMidYMid meet',\r\n imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',\r\n contentVisibility: config && config.contentVisibility || 'visible',\r\n className: config && config.className || '',\r\n id: config && config.id || ''\r\n };\r\n this.renderConfig.dpr = config && config.dpr || 1;\r\n\r\n if (this.animationItem.wrapper) {\r\n this.renderConfig.dpr = config && config.dpr || window.devicePixelRatio || 1;\r\n }\r\n\r\n this.renderedFrame = -1;\r\n this.globalData = {\r\n frameNum: -1,\r\n _mdf: false,\r\n renderConfig: this.renderConfig,\r\n currentGlobalAlpha: -1\r\n };\r\n this.contextData = new CVContextData();\r\n this.elements = [];\r\n this.pendingElements = [];\r\n this.transformMat = new Matrix();\r\n this.completeLayers = false;\r\n this.rendererType = 'canvas';\r\n }\r\n\r\n extendPrototype([BaseRenderer], CanvasRendererBase);\r\n\r\n CanvasRendererBase.prototype.createShape = function (data) {\r\n return new CVShapeElement(data, this.globalData, this);\r\n };\r\n\r\n CanvasRendererBase.prototype.createText = function (data) {\r\n return new CVTextElement(data, this.globalData, this);\r\n };\r\n\r\n CanvasRendererBase.prototype.createImage = function (data) {\r\n return new CVImageElement(data, this.globalData, this);\r\n };\r\n\r\n CanvasRendererBase.prototype.createSolid = function (data) {\r\n return new CVSolidElement(data, this.globalData, this);\r\n };\r\n\r\n CanvasRendererBase.prototype.createNull = SVGRenderer.prototype.createNull;\r\n\r\n CanvasRendererBase.prototype.ctxTransform = function (props) {\r\n if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) {\r\n return;\r\n }\r\n\r\n if (!this.renderConfig.clearCanvas) {\r\n this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]);\r\n return;\r\n } // Resetting the canvas transform matrix to the new transform\r\n\r\n\r\n this.transformMat.cloneFromProps(props); // Taking the last transform value from the stored stack of transforms\r\n\r\n var currentTransform = this.contextData.getTransform();\r\n var cProps = currentTransform.props; // Applying the last transform value after the new transform to respect the order of transformations\r\n\r\n this.transformMat.transform(cProps[0], cProps[1], cProps[2], cProps[3], cProps[4], cProps[5], cProps[6], cProps[7], cProps[8], cProps[9], cProps[10], cProps[11], cProps[12], cProps[13], cProps[14], cProps[15]); // Storing the new transformed value in the stored transform\r\n\r\n currentTransform.cloneFromProps(this.transformMat.props);\r\n var trProps = currentTransform.props; // Applying the new transform to the canvas\r\n\r\n this.canvasContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]);\r\n };\r\n\r\n CanvasRendererBase.prototype.ctxOpacity = function (op) {\r\n /* if(op === 1){\r\n return;\r\n } */\r\n var currentOpacity = this.contextData.getOpacity();\r\n\r\n if (!this.renderConfig.clearCanvas) {\r\n this.canvasContext.globalAlpha *= op < 0 ? 0 : op;\r\n this.globalData.currentGlobalAlpha = currentOpacity;\r\n return;\r\n }\r\n\r\n currentOpacity *= op < 0 ? 0 : op;\r\n this.contextData.setOpacity(currentOpacity);\r\n\r\n if (this.globalData.currentGlobalAlpha !== currentOpacity) {\r\n this.canvasContext.globalAlpha = currentOpacity;\r\n this.globalData.currentGlobalAlpha = currentOpacity;\r\n }\r\n };\r\n\r\n CanvasRendererBase.prototype.reset = function () {\r\n if (!this.renderConfig.clearCanvas) {\r\n this.canvasContext.restore();\r\n return;\r\n }\r\n\r\n this.contextData.reset();\r\n };\r\n\r\n CanvasRendererBase.prototype.save = function (actionFlag) {\r\n if (!this.renderConfig.clearCanvas) {\r\n this.canvasContext.save();\r\n return;\r\n }\r\n\r\n if (actionFlag) {\r\n this.canvasContext.save();\r\n }\r\n\r\n this.contextData.push();\r\n };\r\n\r\n CanvasRendererBase.prototype.restore = function (actionFlag) {\r\n if (!this.renderConfig.clearCanvas) {\r\n this.canvasContext.restore();\r\n return;\r\n }\r\n\r\n if (actionFlag) {\r\n this.canvasContext.restore();\r\n this.globalData.blendMode = 'source-over';\r\n }\r\n\r\n var popped = this.contextData.pop();\r\n var transform = popped.transform;\r\n var opacity = popped.opacity;\r\n this.canvasContext.setTransform(transform[0], transform[1], transform[4], transform[5], transform[12], transform[13]);\r\n\r\n if (this.globalData.currentGlobalAlpha !== opacity) {\r\n this.canvasContext.globalAlpha = opacity;\r\n this.globalData.currentGlobalAlpha = opacity;\r\n }\r\n };\r\n\r\n CanvasRendererBase.prototype.configAnimation = function (animData) {\r\n if (this.animationItem.wrapper) {\r\n this.animationItem.container = createTag('canvas');\r\n var containerStyle = this.animationItem.container.style;\r\n containerStyle.width = '100%';\r\n containerStyle.height = '100%';\r\n var origin = '0px 0px 0px';\r\n containerStyle.transformOrigin = origin;\r\n containerStyle.mozTransformOrigin = origin;\r\n containerStyle.webkitTransformOrigin = origin;\r\n containerStyle['-webkit-transform'] = origin;\r\n containerStyle.contentVisibility = this.renderConfig.contentVisibility;\r\n this.animationItem.wrapper.appendChild(this.animationItem.container);\r\n this.canvasContext = this.animationItem.container.getContext('2d');\r\n\r\n if (this.renderConfig.className) {\r\n this.animationItem.container.setAttribute('class', this.renderConfig.className);\r\n }\r\n\r\n if (this.renderConfig.id) {\r\n this.animationItem.container.setAttribute('id', this.renderConfig.id);\r\n }\r\n } else {\r\n this.canvasContext = this.renderConfig.context;\r\n }\r\n\r\n this.data = animData;\r\n this.layers = animData.layers;\r\n this.transformCanvas = {\r\n w: animData.w,\r\n h: animData.h,\r\n sx: 0,\r\n sy: 0,\r\n tx: 0,\r\n ty: 0\r\n };\r\n this.setupGlobalData(animData, document.body);\r\n this.globalData.canvasContext = this.canvasContext;\r\n this.globalData.renderer = this;\r\n this.globalData.isDashed = false;\r\n this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;\r\n this.globalData.transformCanvas = this.transformCanvas;\r\n this.elements = createSizedArray(animData.layers.length);\r\n this.updateContainerSize();\r\n };\r\n\r\n CanvasRendererBase.prototype.updateContainerSize = function (width, height) {\r\n this.reset();\r\n var elementWidth;\r\n var elementHeight;\r\n\r\n if (width) {\r\n elementWidth = width;\r\n elementHeight = height;\r\n this.canvasContext.canvas.width = elementWidth;\r\n this.canvasContext.canvas.height = elementHeight;\r\n } else {\r\n if (this.animationItem.wrapper && this.animationItem.container) {\r\n elementWidth = this.animationItem.wrapper.offsetWidth;\r\n elementHeight = this.animationItem.wrapper.offsetHeight;\r\n } else {\r\n elementWidth = this.canvasContext.canvas.width;\r\n elementHeight = this.canvasContext.canvas.height;\r\n }\r\n\r\n this.canvasContext.canvas.width = elementWidth * this.renderConfig.dpr;\r\n this.canvasContext.canvas.height = elementHeight * this.renderConfig.dpr;\r\n }\r\n\r\n var elementRel;\r\n var animationRel;\r\n\r\n if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) {\r\n var par = this.renderConfig.preserveAspectRatio.split(' ');\r\n var fillType = par[1] || 'meet';\r\n var pos = par[0] || 'xMidYMid';\r\n var xPos = pos.substr(0, 4);\r\n var yPos = pos.substr(4);\r\n elementRel = elementWidth / elementHeight;\r\n animationRel = this.transformCanvas.w / this.transformCanvas.h;\r\n\r\n if (animationRel > elementRel && fillType === 'meet' || animationRel < elementRel && fillType === 'slice') {\r\n this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);\r\n this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);\r\n } else {\r\n this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);\r\n this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);\r\n }\r\n\r\n if (xPos === 'xMid' && (animationRel < elementRel && fillType === 'meet' || animationRel > elementRel && fillType === 'slice')) {\r\n this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2 * this.renderConfig.dpr;\r\n } else if (xPos === 'xMax' && (animationRel < elementRel && fillType === 'meet' || animationRel > elementRel && fillType === 'slice')) {\r\n this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr;\r\n } else {\r\n this.transformCanvas.tx = 0;\r\n }\r\n\r\n if (yPos === 'YMid' && (animationRel > elementRel && fillType === 'meet' || animationRel < elementRel && fillType === 'slice')) {\r\n this.transformCanvas.ty = (elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2 * this.renderConfig.dpr;\r\n } else if (yPos === 'YMax' && (animationRel > elementRel && fillType === 'meet' || animationRel < elementRel && fillType === 'slice')) {\r\n this.transformCanvas.ty = (elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) * this.renderConfig.dpr;\r\n } else {\r\n this.transformCanvas.ty = 0;\r\n }\r\n } else if (this.renderConfig.preserveAspectRatio === 'none') {\r\n this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);\r\n this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);\r\n this.transformCanvas.tx = 0;\r\n this.transformCanvas.ty = 0;\r\n } else {\r\n this.transformCanvas.sx = this.renderConfig.dpr;\r\n this.transformCanvas.sy = this.renderConfig.dpr;\r\n this.transformCanvas.tx = 0;\r\n this.transformCanvas.ty = 0;\r\n }\r\n\r\n this.transformCanvas.props = [this.transformCanvas.sx, 0, 0, 0, 0, this.transformCanvas.sy, 0, 0, 0, 0, 1, 0, this.transformCanvas.tx, this.transformCanvas.ty, 0, 1];\r\n /* var i, len = this.elements.length;\r\n for(i=0;i= 0; i -= 1) {\r\n if (this.elements[i]) {\r\n this.elements[i].destroy();\r\n }\r\n }\r\n\r\n this.elements.length = 0;\r\n this.globalData.canvasContext = null;\r\n this.animationItem.container = null;\r\n this.destroyed = true;\r\n };\r\n\r\n CanvasRendererBase.prototype.renderFrame = function (num, forceRender) {\r\n if (this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender || this.destroyed || num === -1) {\r\n return;\r\n }\r\n\r\n this.renderedFrame = num;\r\n this.globalData.frameNum = num - this.animationItem._isFirstFrame;\r\n this.globalData.frameId += 1;\r\n this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;\r\n this.globalData.projectInterface.currentFrame = num; // console.log('--------');\r\n // console.log('NEW: ',num);\r\n\r\n var i;\r\n var len = this.layers.length;\r\n\r\n if (!this.completeLayers) {\r\n this.checkLayers(num);\r\n }\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].prepareFrame(num - this.layers[i].st);\r\n }\r\n }\r\n\r\n if (this.globalData._mdf) {\r\n if (this.renderConfig.clearCanvas === true) {\r\n this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);\r\n } else {\r\n this.save();\r\n }\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].renderFrame();\r\n }\r\n }\r\n\r\n if (this.renderConfig.clearCanvas !== true) {\r\n this.restore();\r\n }\r\n }\r\n };\r\n\r\n CanvasRendererBase.prototype.buildItem = function (pos) {\r\n var elements = this.elements;\r\n\r\n if (elements[pos] || this.layers[pos].ty === 99) {\r\n return;\r\n }\r\n\r\n var element = this.createItem(this.layers[pos], this, this.globalData);\r\n elements[pos] = element;\r\n element.initExpressions();\r\n /* if(this.layers[pos].ty === 0){\r\n element.resize(this.globalData.transformCanvas);\r\n } */\r\n };\r\n\r\n CanvasRendererBase.prototype.checkPendingElements = function () {\r\n while (this.pendingElements.length) {\r\n var element = this.pendingElements.pop();\r\n element.checkParenting();\r\n }\r\n };\r\n\r\n CanvasRendererBase.prototype.hide = function () {\r\n this.animationItem.container.style.display = 'none';\r\n };\r\n\r\n CanvasRendererBase.prototype.show = function () {\r\n this.animationItem.container.style.display = 'block';\r\n };\r\n\r\n function CVCompElement(data, globalData, comp) {\r\n this.completeLayers = false;\r\n this.layers = data.layers;\r\n this.pendingElements = [];\r\n this.elements = createSizedArray(this.layers.length);\r\n this.initElement(data, globalData, comp);\r\n this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {\r\n _placeholder: true\r\n };\r\n }\r\n\r\n extendPrototype([CanvasRendererBase, ICompElement, CVBaseElement], CVCompElement);\r\n\r\n CVCompElement.prototype.renderInnerContent = function () {\r\n var ctx = this.canvasContext;\r\n ctx.beginPath();\r\n ctx.moveTo(0, 0);\r\n ctx.lineTo(this.data.w, 0);\r\n ctx.lineTo(this.data.w, this.data.h);\r\n ctx.lineTo(0, this.data.h);\r\n ctx.lineTo(0, 0);\r\n ctx.clip();\r\n var i;\r\n var len = this.layers.length;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (this.completeLayers || this.elements[i]) {\r\n this.elements[i].renderFrame();\r\n }\r\n }\r\n };\r\n\r\n CVCompElement.prototype.destroy = function () {\r\n var i;\r\n var len = this.layers.length;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n if (this.elements[i]) {\r\n this.elements[i].destroy();\r\n }\r\n }\r\n\r\n this.layers = null;\r\n this.elements = null;\r\n };\r\n\r\n CVCompElement.prototype.createComp = function (data) {\r\n return new CVCompElement(data, this.globalData, this);\r\n };\r\n\r\n function CanvasRenderer(animationItem, config) {\r\n this.animationItem = animationItem;\r\n this.renderConfig = {\r\n clearCanvas: config && config.clearCanvas !== undefined ? config.clearCanvas : true,\r\n context: config && config.context || null,\r\n progressiveLoad: config && config.progressiveLoad || false,\r\n preserveAspectRatio: config && config.preserveAspectRatio || 'xMidYMid meet',\r\n imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',\r\n contentVisibility: config && config.contentVisibility || 'visible',\r\n className: config && config.className || '',\r\n id: config && config.id || '',\r\n runExpressions: !config || config.runExpressions === undefined || config.runExpressions\r\n };\r\n this.renderConfig.dpr = config && config.dpr || 1;\r\n\r\n if (this.animationItem.wrapper) {\r\n this.renderConfig.dpr = config && config.dpr || window.devicePixelRatio || 1;\r\n }\r\n\r\n this.renderedFrame = -1;\r\n this.globalData = {\r\n frameNum: -1,\r\n _mdf: false,\r\n renderConfig: this.renderConfig,\r\n currentGlobalAlpha: -1\r\n };\r\n this.contextData = new CVContextData();\r\n this.elements = [];\r\n this.pendingElements = [];\r\n this.transformMat = new Matrix();\r\n this.completeLayers = false;\r\n this.rendererType = 'canvas';\r\n }\r\n\r\n extendPrototype([CanvasRendererBase], CanvasRenderer);\r\n\r\n CanvasRenderer.prototype.createComp = function (data) {\r\n return new CVCompElement(data, this.globalData, this);\r\n };\r\n\r\n function HBaseElement() {}\r\n\r\n HBaseElement.prototype = {\r\n checkBlendMode: function checkBlendMode() {},\r\n initRendererElement: function initRendererElement() {\r\n this.baseElement = createTag(this.data.tg || 'div');\r\n\r\n if (this.data.hasMask) {\r\n this.svgElement = createNS('svg');\r\n this.layerElement = createNS('g');\r\n this.maskedElement = this.layerElement;\r\n this.svgElement.appendChild(this.layerElement);\r\n this.baseElement.appendChild(this.svgElement);\r\n } else {\r\n this.layerElement = this.baseElement;\r\n }\r\n\r\n styleDiv(this.baseElement);\r\n },\r\n createContainerElements: function createContainerElements() {\r\n this.renderableEffectsManager = new CVEffects(this);\r\n this.transformedElement = this.baseElement;\r\n this.maskedElement = this.layerElement;\r\n\r\n if (this.data.ln) {\r\n this.layerElement.setAttribute('id', this.data.ln);\r\n }\r\n\r\n if (this.data.cl) {\r\n this.layerElement.setAttribute('class', this.data.cl);\r\n }\r\n\r\n if (this.data.bm !== 0) {\r\n this.setBlendMode();\r\n }\r\n },\r\n renderElement: function renderElement() {\r\n var transformedElementStyle = this.transformedElement ? this.transformedElement.style : {};\r\n\r\n if (this.finalTransform._matMdf) {\r\n var matrixValue = this.finalTransform.mat.toCSS();\r\n transformedElementStyle.transform = matrixValue;\r\n transformedElementStyle.webkitTransform = matrixValue;\r\n }\r\n\r\n if (this.finalTransform._opMdf) {\r\n transformedElementStyle.opacity = this.finalTransform.mProp.o.v;\r\n }\r\n },\r\n renderFrame: function renderFrame() {\r\n // If it is exported as hidden (data.hd === true) no need to render\r\n // If it is not visible no need to render\r\n if (this.data.hd || this.hidden) {\r\n return;\r\n }\r\n\r\n this.renderTransform();\r\n this.renderRenderable();\r\n this.renderElement();\r\n this.renderInnerContent();\r\n\r\n if (this._isFirstFrame) {\r\n this._isFirstFrame = false;\r\n }\r\n },\r\n destroy: function destroy() {\r\n this.layerElement = null;\r\n this.transformedElement = null;\r\n\r\n if (this.matteElement) {\r\n this.matteElement = null;\r\n }\r\n\r\n if (this.maskManager) {\r\n this.maskManager.destroy();\r\n this.maskManager = null;\r\n }\r\n },\r\n createRenderableComponents: function createRenderableComponents() {\r\n this.maskManager = new MaskElement(this.data, this, this.globalData);\r\n },\r\n addEffects: function addEffects() {},\r\n setMatte: function setMatte() {}\r\n };\r\n HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;\r\n HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;\r\n HBaseElement.prototype.buildElementParenting = BaseRenderer.prototype.buildElementParenting;\r\n\r\n function HSolidElement(data, globalData, comp) {\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement);\r\n\r\n HSolidElement.prototype.createContent = function () {\r\n var rect;\r\n\r\n if (this.data.hasMask) {\r\n rect = createNS('rect');\r\n rect.setAttribute('width', this.data.sw);\r\n rect.setAttribute('height', this.data.sh);\r\n rect.setAttribute('fill', this.data.sc);\r\n this.svgElement.setAttribute('width', this.data.sw);\r\n this.svgElement.setAttribute('height', this.data.sh);\r\n } else {\r\n rect = createTag('div');\r\n rect.style.width = this.data.sw + 'px';\r\n rect.style.height = this.data.sh + 'px';\r\n rect.style.backgroundColor = this.data.sc;\r\n }\r\n\r\n this.layerElement.appendChild(rect);\r\n };\r\n\r\n function HShapeElement(data, globalData, comp) {\r\n // List of drawable elements\r\n this.shapes = []; // Full shape data\r\n\r\n this.shapesData = data.shapes; // List of styles that will be applied to shapes\r\n\r\n this.stylesList = []; // List of modifiers that will be applied to shapes\r\n\r\n this.shapeModifiers = []; // List of items in shape tree\r\n\r\n this.itemsData = []; // List of items in previous shape tree\r\n\r\n this.processedElements = []; // List of animated components\r\n\r\n this.animatedContents = [];\r\n this.shapesContainer = createNS('g');\r\n this.initElement(data, globalData, comp); // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.\r\n // List of elements that have been created\r\n\r\n this.prevViewData = [];\r\n this.currentBBox = {\r\n x: 999999,\r\n y: -999999,\r\n h: 0,\r\n w: 0\r\n };\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement);\r\n HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;\r\n\r\n HShapeElement.prototype.createContent = function () {\r\n var cont;\r\n this.baseElement.style.fontSize = 0;\r\n\r\n if (this.data.hasMask) {\r\n this.layerElement.appendChild(this.shapesContainer);\r\n cont = this.svgElement;\r\n } else {\r\n cont = createNS('svg');\r\n var size = this.comp.data ? this.comp.data : this.globalData.compSize;\r\n cont.setAttribute('width', size.w);\r\n cont.setAttribute('height', size.h);\r\n cont.appendChild(this.shapesContainer);\r\n this.layerElement.appendChild(cont);\r\n }\r\n\r\n this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true);\r\n this.filterUniqueShapes();\r\n this.shapeCont = cont;\r\n };\r\n\r\n HShapeElement.prototype.getTransformedPoint = function (transformers, point) {\r\n var i;\r\n var len = transformers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);\r\n }\r\n\r\n return point;\r\n };\r\n\r\n HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) {\r\n var shape = item.sh.v;\r\n var transformers = item.transformers;\r\n var i;\r\n var len = shape._length;\r\n var vPoint;\r\n var oPoint;\r\n var nextIPoint;\r\n var nextVPoint;\r\n\r\n if (len <= 1) {\r\n return;\r\n }\r\n\r\n for (i = 0; i < len - 1; i += 1) {\r\n vPoint = this.getTransformedPoint(transformers, shape.v[i]);\r\n oPoint = this.getTransformedPoint(transformers, shape.o[i]);\r\n nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);\r\n nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);\r\n this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);\r\n }\r\n\r\n if (shape.c) {\r\n vPoint = this.getTransformedPoint(transformers, shape.v[i]);\r\n oPoint = this.getTransformedPoint(transformers, shape.o[i]);\r\n nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);\r\n nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);\r\n this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);\r\n }\r\n };\r\n\r\n HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {\r\n this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);\r\n var bounds = this.shapeBoundingBox;\r\n boundingBox.x = bmMin(bounds.left, boundingBox.x);\r\n boundingBox.xMax = bmMax(bounds.right, boundingBox.xMax);\r\n boundingBox.y = bmMin(bounds.top, boundingBox.y);\r\n boundingBox.yMax = bmMax(bounds.bottom, boundingBox.yMax);\r\n };\r\n\r\n HShapeElement.prototype.shapeBoundingBox = {\r\n left: 0,\r\n right: 0,\r\n top: 0,\r\n bottom: 0\r\n };\r\n HShapeElement.prototype.tempBoundingBox = {\r\n x: 0,\r\n xMax: 0,\r\n y: 0,\r\n yMax: 0,\r\n width: 0,\r\n height: 0\r\n };\r\n\r\n HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) {\r\n var bounds = [[p0[0], p3[0]], [p0[1], p3[1]]];\r\n\r\n for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {\r\n // eslint-disable-line no-plusplus\r\n b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];\r\n a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];\r\n c = 3 * p1[i] - 3 * p0[i];\r\n b |= 0; // eslint-disable-line no-bitwise\r\n\r\n a |= 0; // eslint-disable-line no-bitwise\r\n\r\n c |= 0; // eslint-disable-line no-bitwise\r\n\r\n if (a === 0 && b === 0) {//\r\n } else if (a === 0) {\r\n t = -c / b;\r\n\r\n if (t > 0 && t < 1) {\r\n bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i));\r\n }\r\n } else {\r\n b2ac = b * b - 4 * c * a;\r\n\r\n if (b2ac >= 0) {\r\n t1 = (-b + bmSqrt(b2ac)) / (2 * a);\r\n if (t1 > 0 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i));\r\n t2 = (-b - bmSqrt(b2ac)) / (2 * a);\r\n if (t2 > 0 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i));\r\n }\r\n }\r\n }\r\n\r\n this.shapeBoundingBox.left = bmMin.apply(null, bounds[0]);\r\n this.shapeBoundingBox.top = bmMin.apply(null, bounds[1]);\r\n this.shapeBoundingBox.right = bmMax.apply(null, bounds[0]);\r\n this.shapeBoundingBox.bottom = bmMax.apply(null, bounds[1]);\r\n };\r\n\r\n HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) {\r\n return bmPow(1 - t, 3) * p0[i] + 3 * bmPow(1 - t, 2) * t * p1[i] + 3 * (1 - t) * bmPow(t, 2) * p2[i] + bmPow(t, 3) * p3[i];\r\n };\r\n\r\n HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) {\r\n var i;\r\n var len = itemsData.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (itemsData[i] && itemsData[i].sh) {\r\n this.calculateShapeBoundingBox(itemsData[i], boundingBox);\r\n } else if (itemsData[i] && itemsData[i].it) {\r\n this.calculateBoundingBox(itemsData[i].it, boundingBox);\r\n } else if (itemsData[i] && itemsData[i].style && itemsData[i].w) {\r\n this.expandStrokeBoundingBox(itemsData[i].w, boundingBox);\r\n }\r\n }\r\n };\r\n\r\n HShapeElement.prototype.expandStrokeBoundingBox = function (widthProperty, boundingBox) {\r\n var width = 0;\r\n\r\n if (widthProperty.keyframes) {\r\n for (var i = 0; i < widthProperty.keyframes.length; i += 1) {\r\n var kfw = widthProperty.keyframes[i].s;\r\n\r\n if (kfw > width) {\r\n width = kfw;\r\n }\r\n }\r\n\r\n width *= widthProperty.mult;\r\n } else {\r\n width = widthProperty.v * widthProperty.mult;\r\n }\r\n\r\n boundingBox.x -= width;\r\n boundingBox.xMax += width;\r\n boundingBox.y -= width;\r\n boundingBox.yMax += width;\r\n };\r\n\r\n HShapeElement.prototype.currentBoxContains = function (box) {\r\n return this.currentBBox.x <= box.x && this.currentBBox.y <= box.y && this.currentBBox.width + this.currentBBox.x >= box.x + box.width && this.currentBBox.height + this.currentBBox.y >= box.y + box.height;\r\n };\r\n\r\n HShapeElement.prototype.renderInnerContent = function () {\r\n this._renderShapeFrame();\r\n\r\n if (!this.hidden && (this._isFirstFrame || this._mdf)) {\r\n var tempBoundingBox = this.tempBoundingBox;\r\n var max = 999999;\r\n tempBoundingBox.x = max;\r\n tempBoundingBox.xMax = -max;\r\n tempBoundingBox.y = max;\r\n tempBoundingBox.yMax = -max;\r\n this.calculateBoundingBox(this.itemsData, tempBoundingBox);\r\n tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;\r\n tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y; // var tempBoundingBox = this.shapeCont.getBBox();\r\n\r\n if (this.currentBoxContains(tempBoundingBox)) {\r\n return;\r\n }\r\n\r\n var changed = false;\r\n\r\n if (this.currentBBox.w !== tempBoundingBox.width) {\r\n this.currentBBox.w = tempBoundingBox.width;\r\n this.shapeCont.setAttribute('width', tempBoundingBox.width);\r\n changed = true;\r\n }\r\n\r\n if (this.currentBBox.h !== tempBoundingBox.height) {\r\n this.currentBBox.h = tempBoundingBox.height;\r\n this.shapeCont.setAttribute('height', tempBoundingBox.height);\r\n changed = true;\r\n }\r\n\r\n if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) {\r\n this.currentBBox.w = tempBoundingBox.width;\r\n this.currentBBox.h = tempBoundingBox.height;\r\n this.currentBBox.x = tempBoundingBox.x;\r\n this.currentBBox.y = tempBoundingBox.y;\r\n this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);\r\n var shapeStyle = this.shapeCont.style;\r\n var shapeTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';\r\n shapeStyle.transform = shapeTransform;\r\n shapeStyle.webkitTransform = shapeTransform;\r\n }\r\n }\r\n };\r\n\r\n function HTextElement(data, globalData, comp) {\r\n this.textSpans = [];\r\n this.textPaths = [];\r\n this.currentBBox = {\r\n x: 999999,\r\n y: -999999,\r\n h: 0,\r\n w: 0\r\n };\r\n this.renderType = 'svg';\r\n this.isMasked = false;\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement);\r\n\r\n HTextElement.prototype.createContent = function () {\r\n this.isMasked = this.checkMasks();\r\n\r\n if (this.isMasked) {\r\n this.renderType = 'svg';\r\n this.compW = this.comp.data.w;\r\n this.compH = this.comp.data.h;\r\n this.svgElement.setAttribute('width', this.compW);\r\n this.svgElement.setAttribute('height', this.compH);\r\n var g = createNS('g');\r\n this.maskedElement.appendChild(g);\r\n this.innerElem = g;\r\n } else {\r\n this.renderType = 'html';\r\n this.innerElem = this.layerElement;\r\n }\r\n\r\n this.checkParenting();\r\n };\r\n\r\n HTextElement.prototype.buildNewText = function () {\r\n var documentData = this.textProperty.currentData;\r\n this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);\r\n var innerElemStyle = this.innerElem.style;\r\n var textColor = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';\r\n innerElemStyle.fill = textColor;\r\n innerElemStyle.color = textColor;\r\n\r\n if (documentData.sc) {\r\n innerElemStyle.stroke = this.buildColor(documentData.sc);\r\n innerElemStyle.strokeWidth = documentData.sw + 'px';\r\n }\r\n\r\n var fontData = this.globalData.fontManager.getFontByName(documentData.f);\r\n\r\n if (!this.globalData.fontManager.chars) {\r\n innerElemStyle.fontSize = documentData.finalSize + 'px';\r\n innerElemStyle.lineHeight = documentData.finalSize + 'px';\r\n\r\n if (fontData.fClass) {\r\n this.innerElem.className = fontData.fClass;\r\n } else {\r\n innerElemStyle.fontFamily = fontData.fFamily;\r\n var fWeight = documentData.fWeight;\r\n var fStyle = documentData.fStyle;\r\n innerElemStyle.fontStyle = fStyle;\r\n innerElemStyle.fontWeight = fWeight;\r\n }\r\n }\r\n\r\n var i;\r\n var len;\r\n var letters = documentData.l;\r\n len = letters.length;\r\n var tSpan;\r\n var tParent;\r\n var tCont;\r\n var matrixHelper = this.mHelper;\r\n var shapes;\r\n var shapeStr = '';\r\n var cnt = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.globalData.fontManager.chars) {\r\n if (!this.textPaths[cnt]) {\r\n tSpan = createNS('path');\r\n tSpan.setAttribute('stroke-linecap', lineCapEnum[1]);\r\n tSpan.setAttribute('stroke-linejoin', lineJoinEnum[2]);\r\n tSpan.setAttribute('stroke-miterlimit', '4');\r\n } else {\r\n tSpan = this.textPaths[cnt];\r\n }\r\n\r\n if (!this.isMasked) {\r\n if (this.textSpans[cnt]) {\r\n tParent = this.textSpans[cnt];\r\n tCont = tParent.children[0];\r\n } else {\r\n tParent = createTag('div');\r\n tParent.style.lineHeight = 0;\r\n tCont = createNS('svg');\r\n tCont.appendChild(tSpan);\r\n styleDiv(tParent);\r\n }\r\n }\r\n } else if (!this.isMasked) {\r\n if (this.textSpans[cnt]) {\r\n tParent = this.textSpans[cnt];\r\n tSpan = this.textPaths[cnt];\r\n } else {\r\n tParent = createTag('span');\r\n styleDiv(tParent);\r\n tSpan = createTag('span');\r\n styleDiv(tSpan);\r\n tParent.appendChild(tSpan);\r\n }\r\n } else {\r\n tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');\r\n } // tSpan.setAttribute('visibility', 'hidden');\r\n\r\n\r\n if (this.globalData.fontManager.chars) {\r\n var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);\r\n var shapeData;\r\n\r\n if (charData) {\r\n shapeData = charData.data;\r\n } else {\r\n shapeData = null;\r\n }\r\n\r\n matrixHelper.reset();\r\n\r\n if (shapeData && shapeData.shapes && shapeData.shapes.length) {\r\n shapes = shapeData.shapes[0].it;\r\n matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);\r\n shapeStr = this.createPathShape(matrixHelper, shapes);\r\n tSpan.setAttribute('d', shapeStr);\r\n }\r\n\r\n if (!this.isMasked) {\r\n this.innerElem.appendChild(tParent);\r\n\r\n if (shapeData && shapeData.shapes) {\r\n // document.body.appendChild is needed to get exact measure of shape\r\n document.body.appendChild(tCont);\r\n var boundingBox = tCont.getBBox();\r\n tCont.setAttribute('width', boundingBox.width + 2);\r\n tCont.setAttribute('height', boundingBox.height + 2);\r\n tCont.setAttribute('viewBox', boundingBox.x - 1 + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2));\r\n var tContStyle = tCont.style;\r\n var tContTranslation = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)';\r\n tContStyle.transform = tContTranslation;\r\n tContStyle.webkitTransform = tContTranslation;\r\n letters[i].yOffset = boundingBox.y - 1;\r\n } else {\r\n tCont.setAttribute('width', 1);\r\n tCont.setAttribute('height', 1);\r\n }\r\n\r\n tParent.appendChild(tCont);\r\n } else {\r\n this.innerElem.appendChild(tSpan);\r\n }\r\n } else {\r\n tSpan.textContent = letters[i].val;\r\n tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\r\n\r\n if (!this.isMasked) {\r\n this.innerElem.appendChild(tParent); //\r\n\r\n var tStyle = tSpan.style;\r\n var tSpanTranslation = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)';\r\n tStyle.transform = tSpanTranslation;\r\n tStyle.webkitTransform = tSpanTranslation;\r\n } else {\r\n this.innerElem.appendChild(tSpan);\r\n }\r\n } //\r\n\r\n\r\n if (!this.isMasked) {\r\n this.textSpans[cnt] = tParent;\r\n } else {\r\n this.textSpans[cnt] = tSpan;\r\n }\r\n\r\n this.textSpans[cnt].style.display = 'block';\r\n this.textPaths[cnt] = tSpan;\r\n cnt += 1;\r\n }\r\n\r\n while (cnt < this.textSpans.length) {\r\n this.textSpans[cnt].style.display = 'none';\r\n cnt += 1;\r\n }\r\n };\r\n\r\n HTextElement.prototype.renderInnerContent = function () {\r\n var svgStyle;\r\n\r\n if (this.data.singleShape) {\r\n if (!this._isFirstFrame && !this.lettersChangedFlag) {\r\n return;\r\n }\r\n\r\n if (this.isMasked && this.finalTransform._matMdf) {\r\n // Todo Benchmark if using this is better than getBBox\r\n this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH);\r\n svgStyle = this.svgElement.style;\r\n var translation = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';\r\n svgStyle.transform = translation;\r\n svgStyle.webkitTransform = translation;\r\n }\r\n }\r\n\r\n this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);\r\n\r\n if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) {\r\n return;\r\n }\r\n\r\n var i;\r\n var len;\r\n var count = 0;\r\n var renderedLetters = this.textAnimator.renderedLetters;\r\n var letters = this.textProperty.currentData.l;\r\n len = letters.length;\r\n var renderedLetter;\r\n var textSpan;\r\n var textPath;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (letters[i].n) {\r\n count += 1;\r\n } else {\r\n textSpan = this.textSpans[i];\r\n textPath = this.textPaths[i];\r\n renderedLetter = renderedLetters[count];\r\n count += 1;\r\n\r\n if (renderedLetter._mdf.m) {\r\n if (!this.isMasked) {\r\n textSpan.style.webkitTransform = renderedLetter.m;\r\n textSpan.style.transform = renderedLetter.m;\r\n } else {\r\n textSpan.setAttribute('transform', renderedLetter.m);\r\n }\r\n } /// /textSpan.setAttribute('opacity',renderedLetter.o);\r\n\r\n\r\n textSpan.style.opacity = renderedLetter.o;\r\n\r\n if (renderedLetter.sw && renderedLetter._mdf.sw) {\r\n textPath.setAttribute('stroke-width', renderedLetter.sw);\r\n }\r\n\r\n if (renderedLetter.sc && renderedLetter._mdf.sc) {\r\n textPath.setAttribute('stroke', renderedLetter.sc);\r\n }\r\n\r\n if (renderedLetter.fc && renderedLetter._mdf.fc) {\r\n textPath.setAttribute('fill', renderedLetter.fc);\r\n textPath.style.color = renderedLetter.fc;\r\n }\r\n }\r\n }\r\n\r\n if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {\r\n var boundingBox = this.innerElem.getBBox();\r\n\r\n if (this.currentBBox.w !== boundingBox.width) {\r\n this.currentBBox.w = boundingBox.width;\r\n this.svgElement.setAttribute('width', boundingBox.width);\r\n }\r\n\r\n if (this.currentBBox.h !== boundingBox.height) {\r\n this.currentBBox.h = boundingBox.height;\r\n this.svgElement.setAttribute('height', boundingBox.height);\r\n }\r\n\r\n var margin = 1;\r\n\r\n if (this.currentBBox.w !== boundingBox.width + margin * 2 || this.currentBBox.h !== boundingBox.height + margin * 2 || this.currentBBox.x !== boundingBox.x - margin || this.currentBBox.y !== boundingBox.y - margin) {\r\n this.currentBBox.w = boundingBox.width + margin * 2;\r\n this.currentBBox.h = boundingBox.height + margin * 2;\r\n this.currentBBox.x = boundingBox.x - margin;\r\n this.currentBBox.y = boundingBox.y - margin;\r\n this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);\r\n svgStyle = this.svgElement.style;\r\n var svgTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';\r\n svgStyle.transform = svgTransform;\r\n svgStyle.webkitTransform = svgTransform;\r\n }\r\n }\r\n };\r\n\r\n function HCameraElement(data, globalData, comp) {\r\n this.initFrame();\r\n this.initBaseData(data, globalData, comp);\r\n this.initHierarchy();\r\n var getProp = PropertyFactory.getProp;\r\n this.pe = getProp(this, data.pe, 0, 0, this);\r\n\r\n if (data.ks.p.s) {\r\n this.px = getProp(this, data.ks.p.x, 1, 0, this);\r\n this.py = getProp(this, data.ks.p.y, 1, 0, this);\r\n this.pz = getProp(this, data.ks.p.z, 1, 0, this);\r\n } else {\r\n this.p = getProp(this, data.ks.p, 1, 0, this);\r\n }\r\n\r\n if (data.ks.a) {\r\n this.a = getProp(this, data.ks.a, 1, 0, this);\r\n }\r\n\r\n if (data.ks.or.k.length && data.ks.or.k[0].to) {\r\n var i;\r\n var len = data.ks.or.k.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n data.ks.or.k[i].to = null;\r\n data.ks.or.k[i].ti = null;\r\n }\r\n }\r\n\r\n this.or = getProp(this, data.ks.or, 1, degToRads, this);\r\n this.or.sh = true;\r\n this.rx = getProp(this, data.ks.rx, 0, degToRads, this);\r\n this.ry = getProp(this, data.ks.ry, 0, degToRads, this);\r\n this.rz = getProp(this, data.ks.rz, 0, degToRads, this);\r\n this.mat = new Matrix();\r\n this._prevMat = new Matrix();\r\n this._isFirstFrame = true; // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.\r\n\r\n this.finalTransform = {\r\n mProp: this\r\n };\r\n }\r\n\r\n extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);\r\n\r\n HCameraElement.prototype.setup = function () {\r\n var i;\r\n var len = this.comp.threeDElements.length;\r\n var comp;\r\n var perspectiveStyle;\r\n var containerStyle;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n // [perspectiveElem,container]\r\n comp = this.comp.threeDElements[i];\r\n\r\n if (comp.type === '3d') {\r\n perspectiveStyle = comp.perspectiveElem.style;\r\n containerStyle = comp.container.style;\r\n var perspective = this.pe.v + 'px';\r\n var origin = '0px 0px 0px';\r\n var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';\r\n perspectiveStyle.perspective = perspective;\r\n perspectiveStyle.webkitPerspective = perspective;\r\n containerStyle.transformOrigin = origin;\r\n containerStyle.mozTransformOrigin = origin;\r\n containerStyle.webkitTransformOrigin = origin;\r\n perspectiveStyle.transform = matrix;\r\n perspectiveStyle.webkitTransform = matrix;\r\n }\r\n }\r\n };\r\n\r\n HCameraElement.prototype.createElements = function () {};\r\n\r\n HCameraElement.prototype.hide = function () {};\r\n\r\n HCameraElement.prototype.renderFrame = function () {\r\n var _mdf = this._isFirstFrame;\r\n var i;\r\n var len;\r\n\r\n if (this.hierarchy) {\r\n len = this.hierarchy.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;\r\n }\r\n }\r\n\r\n if (_mdf || this.pe._mdf || this.p && this.p._mdf || this.px && (this.px._mdf || this.py._mdf || this.pz._mdf) || this.rx._mdf || this.ry._mdf || this.rz._mdf || this.or._mdf || this.a && this.a._mdf) {\r\n this.mat.reset();\r\n\r\n if (this.hierarchy) {\r\n len = this.hierarchy.length - 1;\r\n\r\n for (i = len; i >= 0; i -= 1) {\r\n var mTransf = this.hierarchy[i].finalTransform.mProp;\r\n this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]);\r\n this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);\r\n this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);\r\n this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]);\r\n this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]);\r\n }\r\n }\r\n\r\n if (this.p) {\r\n this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]);\r\n } else {\r\n this.mat.translate(-this.px.v, -this.py.v, this.pz.v);\r\n }\r\n\r\n if (this.a) {\r\n var diffVector;\r\n\r\n if (this.p) {\r\n diffVector = [this.p.v[0] - this.a.v[0], this.p.v[1] - this.a.v[1], this.p.v[2] - this.a.v[2]];\r\n } else {\r\n diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];\r\n }\r\n\r\n var mag = Math.sqrt(Math.pow(diffVector[0], 2) + Math.pow(diffVector[1], 2) + Math.pow(diffVector[2], 2)); // var lookDir = getNormalizedPoint(getDiffVector(this.a.v,this.p.v));\r\n\r\n var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag];\r\n var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]);\r\n var mRotationX = Math.atan2(lookDir[1], lookLengthOnXZ);\r\n var mRotationY = Math.atan2(lookDir[0], -lookDir[2]);\r\n this.mat.rotateY(mRotationY).rotateX(-mRotationX);\r\n }\r\n\r\n this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);\r\n this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);\r\n this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0);\r\n this.mat.translate(0, 0, this.pe.v);\r\n var hasMatrixChanged = !this._prevMat.equals(this.mat);\r\n\r\n if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {\r\n len = this.comp.threeDElements.length;\r\n var comp;\r\n var perspectiveStyle;\r\n var containerStyle;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n comp = this.comp.threeDElements[i];\r\n\r\n if (comp.type === '3d') {\r\n if (hasMatrixChanged) {\r\n var matValue = this.mat.toCSS();\r\n containerStyle = comp.container.style;\r\n containerStyle.transform = matValue;\r\n containerStyle.webkitTransform = matValue;\r\n }\r\n\r\n if (this.pe._mdf) {\r\n perspectiveStyle = comp.perspectiveElem.style;\r\n perspectiveStyle.perspective = this.pe.v + 'px';\r\n perspectiveStyle.webkitPerspective = this.pe.v + 'px';\r\n }\r\n }\r\n }\r\n\r\n this.mat.clone(this._prevMat);\r\n }\r\n }\r\n\r\n this._isFirstFrame = false;\r\n };\r\n\r\n HCameraElement.prototype.prepareFrame = function (num) {\r\n this.prepareProperties(num, true);\r\n };\r\n\r\n HCameraElement.prototype.destroy = function () {};\r\n\r\n HCameraElement.prototype.getBaseElement = function () {\r\n return null;\r\n };\r\n\r\n function HImageElement(data, globalData, comp) {\r\n this.assetData = globalData.getAssetData(data.refId);\r\n this.initElement(data, globalData, comp);\r\n }\r\n\r\n extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement);\r\n\r\n HImageElement.prototype.createContent = function () {\r\n var assetPath = this.globalData.getAssetsPath(this.assetData);\r\n var img = new Image();\r\n\r\n if (this.data.hasMask) {\r\n this.imageElem = createNS('image');\r\n this.imageElem.setAttribute('width', this.assetData.w + 'px');\r\n this.imageElem.setAttribute('height', this.assetData.h + 'px');\r\n this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);\r\n this.layerElement.appendChild(this.imageElem);\r\n this.baseElement.setAttribute('width', this.assetData.w);\r\n this.baseElement.setAttribute('height', this.assetData.h);\r\n } else {\r\n this.layerElement.appendChild(img);\r\n }\r\n\r\n img.crossOrigin = 'anonymous';\r\n img.src = assetPath;\r\n\r\n if (this.data.ln) {\r\n this.baseElement.setAttribute('id', this.data.ln);\r\n }\r\n };\r\n\r\n function HybridRendererBase(animationItem, config) {\r\n this.animationItem = animationItem;\r\n this.layers = null;\r\n this.renderedFrame = -1;\r\n this.renderConfig = {\r\n className: config && config.className || '',\r\n imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',\r\n hideOnTransparent: !(config && config.hideOnTransparent === false),\r\n filterSize: {\r\n width: config && config.filterSize && config.filterSize.width || '400%',\r\n height: config && config.filterSize && config.filterSize.height || '400%',\r\n x: config && config.filterSize && config.filterSize.x || '-100%',\r\n y: config && config.filterSize && config.filterSize.y || '-100%'\r\n }\r\n };\r\n this.globalData = {\r\n _mdf: false,\r\n frameNum: -1,\r\n renderConfig: this.renderConfig\r\n };\r\n this.pendingElements = [];\r\n this.elements = [];\r\n this.threeDElements = [];\r\n this.destroyed = false;\r\n this.camera = null;\r\n this.supports3d = true;\r\n this.rendererType = 'html';\r\n }\r\n\r\n extendPrototype([BaseRenderer], HybridRendererBase);\r\n HybridRendererBase.prototype.buildItem = SVGRenderer.prototype.buildItem;\r\n\r\n HybridRendererBase.prototype.checkPendingElements = function () {\r\n while (this.pendingElements.length) {\r\n var element = this.pendingElements.pop();\r\n element.checkParenting();\r\n }\r\n };\r\n\r\n HybridRendererBase.prototype.appendElementInPos = function (element, pos) {\r\n var newDOMElement = element.getBaseElement();\r\n\r\n if (!newDOMElement) {\r\n return;\r\n }\r\n\r\n var layer = this.layers[pos];\r\n\r\n if (!layer.ddd || !this.supports3d) {\r\n if (this.threeDElements) {\r\n this.addTo3dContainer(newDOMElement, pos);\r\n } else {\r\n var i = 0;\r\n var nextDOMElement;\r\n var nextLayer;\r\n var tmpDOMElement;\r\n\r\n while (i < pos) {\r\n if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement) {\r\n nextLayer = this.elements[i];\r\n tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();\r\n nextDOMElement = tmpDOMElement || nextDOMElement;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (nextDOMElement) {\r\n if (!layer.ddd || !this.supports3d) {\r\n this.layerElement.insertBefore(newDOMElement, nextDOMElement);\r\n }\r\n } else if (!layer.ddd || !this.supports3d) {\r\n this.layerElement.appendChild(newDOMElement);\r\n }\r\n }\r\n } else {\r\n this.addTo3dContainer(newDOMElement, pos);\r\n }\r\n };\r\n\r\n HybridRendererBase.prototype.createShape = function (data) {\r\n if (!this.supports3d) {\r\n return new SVGShapeElement(data, this.globalData, this);\r\n }\r\n\r\n return new HShapeElement(data, this.globalData, this);\r\n };\r\n\r\n HybridRendererBase.prototype.createText = function (data) {\r\n if (!this.supports3d) {\r\n return new SVGTextLottieElement(data, this.globalData, this);\r\n }\r\n\r\n return new HTextElement(data, this.globalData, this);\r\n };\r\n\r\n HybridRendererBase.prototype.createCamera = function (data) {\r\n this.camera = new HCameraElement(data, this.globalData, this);\r\n return this.camera;\r\n };\r\n\r\n HybridRendererBase.prototype.createImage = function (data) {\r\n if (!this.supports3d) {\r\n return new IImageElement(data, this.globalData, this);\r\n }\r\n\r\n return new HImageElement(data, this.globalData, this);\r\n };\r\n\r\n HybridRendererBase.prototype.createSolid = function (data) {\r\n if (!this.supports3d) {\r\n return new ISolidElement(data, this.globalData, this);\r\n }\r\n\r\n return new HSolidElement(data, this.globalData, this);\r\n };\r\n\r\n HybridRendererBase.prototype.createNull = SVGRenderer.prototype.createNull;\r\n\r\n HybridRendererBase.prototype.getThreeDContainerByPos = function (pos) {\r\n var i = 0;\r\n var len = this.threeDElements.length;\r\n\r\n while (i < len) {\r\n if (this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {\r\n return this.threeDElements[i].perspectiveElem;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n };\r\n\r\n HybridRendererBase.prototype.createThreeDContainer = function (pos, type) {\r\n var perspectiveElem = createTag('div');\r\n var style;\r\n var containerStyle;\r\n styleDiv(perspectiveElem);\r\n var container = createTag('div');\r\n styleDiv(container);\r\n\r\n if (type === '3d') {\r\n style = perspectiveElem.style;\r\n style.width = this.globalData.compSize.w + 'px';\r\n style.height = this.globalData.compSize.h + 'px';\r\n var center = '50% 50%';\r\n style.webkitTransformOrigin = center;\r\n style.mozTransformOrigin = center;\r\n style.transformOrigin = center;\r\n containerStyle = container.style;\r\n var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';\r\n containerStyle.transform = matrix;\r\n containerStyle.webkitTransform = matrix;\r\n }\r\n\r\n perspectiveElem.appendChild(container); // this.resizerElem.appendChild(perspectiveElem);\r\n\r\n var threeDContainerData = {\r\n container: container,\r\n perspectiveElem: perspectiveElem,\r\n startPos: pos,\r\n endPos: pos,\r\n type: type\r\n };\r\n this.threeDElements.push(threeDContainerData);\r\n return threeDContainerData;\r\n };\r\n\r\n HybridRendererBase.prototype.build3dContainers = function () {\r\n var i;\r\n var len = this.layers.length;\r\n var lastThreeDContainerData;\r\n var currentContainer = '';\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.layers[i].ddd && this.layers[i].ty !== 3) {\r\n if (currentContainer !== '3d') {\r\n currentContainer = '3d';\r\n lastThreeDContainerData = this.createThreeDContainer(i, '3d');\r\n }\r\n\r\n lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);\r\n } else {\r\n if (currentContainer !== '2d') {\r\n currentContainer = '2d';\r\n lastThreeDContainerData = this.createThreeDContainer(i, '2d');\r\n }\r\n\r\n lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);\r\n }\r\n }\r\n\r\n len = this.threeDElements.length;\r\n\r\n for (i = len - 1; i >= 0; i -= 1) {\r\n this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);\r\n }\r\n };\r\n\r\n HybridRendererBase.prototype.addTo3dContainer = function (elem, pos) {\r\n var i = 0;\r\n var len = this.threeDElements.length;\r\n\r\n while (i < len) {\r\n if (pos <= this.threeDElements[i].endPos) {\r\n var j = this.threeDElements[i].startPos;\r\n var nextElement;\r\n\r\n while (j < pos) {\r\n if (this.elements[j] && this.elements[j].getBaseElement) {\r\n nextElement = this.elements[j].getBaseElement();\r\n }\r\n\r\n j += 1;\r\n }\r\n\r\n if (nextElement) {\r\n this.threeDElements[i].container.insertBefore(elem, nextElement);\r\n } else {\r\n this.threeDElements[i].container.appendChild(elem);\r\n }\r\n\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n };\r\n\r\n HybridRendererBase.prototype.configAnimation = function (animData) {\r\n var resizerElem = createTag('div');\r\n var wrapper = this.animationItem.wrapper;\r\n var style = resizerElem.style;\r\n style.width = animData.w + 'px';\r\n style.height = animData.h + 'px';\r\n this.resizerElem = resizerElem;\r\n styleDiv(resizerElem);\r\n style.transformStyle = 'flat';\r\n style.mozTransformStyle = 'flat';\r\n style.webkitTransformStyle = 'flat';\r\n\r\n if (this.renderConfig.className) {\r\n resizerElem.setAttribute('class', this.renderConfig.className);\r\n }\r\n\r\n wrapper.appendChild(resizerElem);\r\n style.overflow = 'hidden';\r\n var svg = createNS('svg');\r\n svg.setAttribute('width', '1');\r\n svg.setAttribute('height', '1');\r\n styleDiv(svg);\r\n this.resizerElem.appendChild(svg);\r\n var defs = createNS('defs');\r\n svg.appendChild(defs);\r\n this.data = animData; // Mask animation\r\n\r\n this.setupGlobalData(animData, svg);\r\n this.globalData.defs = defs;\r\n this.layers = animData.layers;\r\n this.layerElement = this.resizerElem;\r\n this.build3dContainers();\r\n this.updateContainerSize();\r\n };\r\n\r\n HybridRendererBase.prototype.destroy = function () {\r\n if (this.animationItem.wrapper) {\r\n this.animationItem.wrapper.innerText = '';\r\n }\r\n\r\n this.animationItem.container = null;\r\n this.globalData.defs = null;\r\n var i;\r\n var len = this.layers ? this.layers.length : 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this.elements[i].destroy();\r\n }\r\n\r\n this.elements.length = 0;\r\n this.destroyed = true;\r\n this.animationItem = null;\r\n };\r\n\r\n HybridRendererBase.prototype.updateContainerSize = function () {\r\n var elementWidth = this.animationItem.wrapper.offsetWidth;\r\n var elementHeight = this.animationItem.wrapper.offsetHeight;\r\n var elementRel = elementWidth / elementHeight;\r\n var animationRel = this.globalData.compSize.w / this.globalData.compSize.h;\r\n var sx;\r\n var sy;\r\n var tx;\r\n var ty;\r\n\r\n if (animationRel > elementRel) {\r\n sx = elementWidth / this.globalData.compSize.w;\r\n sy = elementWidth / this.globalData.compSize.w;\r\n tx = 0;\r\n ty = (elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2;\r\n } else {\r\n sx = elementHeight / this.globalData.compSize.h;\r\n sy = elementHeight / this.globalData.compSize.h;\r\n tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2;\r\n ty = 0;\r\n }\r\n\r\n var style = this.resizerElem.style;\r\n style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)';\r\n style.transform = style.webkitTransform;\r\n };\r\n\r\n HybridRendererBase.prototype.renderFrame = SVGRenderer.prototype.renderFrame;\r\n\r\n HybridRendererBase.prototype.hide = function () {\r\n this.resizerElem.style.display = 'none';\r\n };\r\n\r\n HybridRendererBase.prototype.show = function () {\r\n this.resizerElem.style.display = 'block';\r\n };\r\n\r\n HybridRendererBase.prototype.initItems = function () {\r\n this.buildAllItems();\r\n\r\n if (this.camera) {\r\n this.camera.setup();\r\n } else {\r\n var cWidth = this.globalData.compSize.w;\r\n var cHeight = this.globalData.compSize.h;\r\n var i;\r\n var len = this.threeDElements.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n var style = this.threeDElements[i].perspectiveElem.style;\r\n style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px';\r\n style.perspective = style.webkitPerspective;\r\n }\r\n }\r\n };\r\n\r\n HybridRendererBase.prototype.searchExtraCompositions = function (assets) {\r\n var i;\r\n var len = assets.length;\r\n var floatingContainer = createTag('div');\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (assets[i].xt) {\r\n var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null);\r\n comp.initExpressions();\r\n this.globalData.projectInterface.registerComposition(comp);\r\n }\r\n }\r\n };\r\n\r\n function HCompElement(data, globalData, comp) {\r\n this.layers = data.layers;\r\n this.supports3d = !data.hasMask;\r\n this.completeLayers = false;\r\n this.pendingElements = [];\r\n this.elements = this.layers ? createSizedArray(this.layers.length) : [];\r\n this.initElement(data, globalData, comp);\r\n this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {\r\n _placeholder: true\r\n };\r\n }\r\n\r\n extendPrototype([HybridRendererBase, ICompElement, HBaseElement], HCompElement);\r\n HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;\r\n\r\n HCompElement.prototype.createContainerElements = function () {\r\n this._createBaseContainerElements(); // divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';\r\n\r\n\r\n if (this.data.hasMask) {\r\n this.svgElement.setAttribute('width', this.data.w);\r\n this.svgElement.setAttribute('height', this.data.h);\r\n this.transformedElement = this.baseElement;\r\n } else {\r\n this.transformedElement = this.layerElement;\r\n }\r\n };\r\n\r\n HCompElement.prototype.addTo3dContainer = function (elem, pos) {\r\n var j = 0;\r\n var nextElement;\r\n\r\n while (j < pos) {\r\n if (this.elements[j] && this.elements[j].getBaseElement) {\r\n nextElement = this.elements[j].getBaseElement();\r\n }\r\n\r\n j += 1;\r\n }\r\n\r\n if (nextElement) {\r\n this.layerElement.insertBefore(elem, nextElement);\r\n } else {\r\n this.layerElement.appendChild(elem);\r\n }\r\n };\r\n\r\n HCompElement.prototype.createComp = function (data) {\r\n if (!this.supports3d) {\r\n return new SVGCompElement(data, this.globalData, this);\r\n }\r\n\r\n return new HCompElement(data, this.globalData, this);\r\n };\r\n\r\n function HybridRenderer(animationItem, config) {\r\n this.animationItem = animationItem;\r\n this.layers = null;\r\n this.renderedFrame = -1;\r\n this.renderConfig = {\r\n className: config && config.className || '',\r\n imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',\r\n hideOnTransparent: !(config && config.hideOnTransparent === false),\r\n filterSize: {\r\n width: config && config.filterSize && config.filterSize.width || '400%',\r\n height: config && config.filterSize && config.filterSize.height || '400%',\r\n x: config && config.filterSize && config.filterSize.x || '-100%',\r\n y: config && config.filterSize && config.filterSize.y || '-100%'\r\n },\r\n runExpressions: !config || config.runExpressions === undefined || config.runExpressions\r\n };\r\n this.globalData = {\r\n _mdf: false,\r\n frameNum: -1,\r\n renderConfig: this.renderConfig\r\n };\r\n this.pendingElements = [];\r\n this.elements = [];\r\n this.threeDElements = [];\r\n this.destroyed = false;\r\n this.camera = null;\r\n this.supports3d = true;\r\n this.rendererType = 'html';\r\n }\r\n\r\n extendPrototype([HybridRendererBase], HybridRenderer);\r\n\r\n HybridRenderer.prototype.createComp = function (data) {\r\n if (!this.supports3d) {\r\n return new SVGCompElement(data, this.globalData, this);\r\n }\r\n\r\n return new HCompElement(data, this.globalData, this);\r\n };\r\n\r\n var CompExpressionInterface = function () {\r\n return function (comp) {\r\n function _thisLayerFunction(name) {\r\n var i = 0;\r\n var len = comp.layers.length;\r\n\r\n while (i < len) {\r\n if (comp.layers[i].nm === name || comp.layers[i].ind === name) {\r\n return comp.elements[i].layerInterface;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null; // return {active:false};\r\n }\r\n\r\n Object.defineProperty(_thisLayerFunction, '_name', {\r\n value: comp.data.nm\r\n });\r\n _thisLayerFunction.layer = _thisLayerFunction;\r\n _thisLayerFunction.pixelAspect = 1;\r\n _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;\r\n _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;\r\n _thisLayerFunction.pixelAspect = 1;\r\n _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;\r\n _thisLayerFunction.displayStartTime = 0;\r\n _thisLayerFunction.numLayers = comp.layers.length;\r\n return _thisLayerFunction;\r\n };\r\n }();\r\n\r\n var Expressions = function () {\r\n var ob = {};\r\n ob.initExpressions = initExpressions;\r\n\r\n function initExpressions(animation) {\r\n var stackCount = 0;\r\n var registers = [];\r\n\r\n function pushExpression() {\r\n stackCount += 1;\r\n }\r\n\r\n function popExpression() {\r\n stackCount -= 1;\r\n\r\n if (stackCount === 0) {\r\n releaseInstances();\r\n }\r\n }\r\n\r\n function registerExpressionProperty(expression) {\r\n if (registers.indexOf(expression) === -1) {\r\n registers.push(expression);\r\n }\r\n }\r\n\r\n function releaseInstances() {\r\n var i;\r\n var len = registers.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n registers[i].release();\r\n }\r\n\r\n registers.length = 0;\r\n }\r\n\r\n animation.renderer.compInterface = CompExpressionInterface(animation.renderer);\r\n animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);\r\n animation.renderer.globalData.pushExpression = pushExpression;\r\n animation.renderer.globalData.popExpression = popExpression;\r\n animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n var MaskManagerInterface = function () {\r\n function MaskInterface(mask, data) {\r\n this._mask = mask;\r\n this._data = data;\r\n }\r\n\r\n Object.defineProperty(MaskInterface.prototype, 'maskPath', {\r\n get: function get() {\r\n if (this._mask.prop.k) {\r\n this._mask.prop.getValue();\r\n }\r\n\r\n return this._mask.prop;\r\n }\r\n });\r\n Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {\r\n get: function get() {\r\n if (this._mask.op.k) {\r\n this._mask.op.getValue();\r\n }\r\n\r\n return this._mask.op.v * 100;\r\n }\r\n });\r\n\r\n var MaskManager = function MaskManager(maskManager) {\r\n var _masksInterfaces = createSizedArray(maskManager.viewData.length);\r\n\r\n var i;\r\n var len = maskManager.viewData.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);\r\n }\r\n\r\n var maskFunction = function maskFunction(name) {\r\n i = 0;\r\n\r\n while (i < len) {\r\n if (maskManager.masksProperties[i].nm === name) {\r\n return _masksInterfaces[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n };\r\n\r\n return maskFunction;\r\n };\r\n\r\n return MaskManager;\r\n }();\r\n\r\n var ExpressionPropertyInterface = function () {\r\n var defaultUnidimensionalValue = {\r\n pv: 0,\r\n v: 0,\r\n mult: 1\r\n };\r\n var defaultMultidimensionalValue = {\r\n pv: [0, 0, 0],\r\n v: [0, 0, 0],\r\n mult: 1\r\n };\r\n\r\n function completeProperty(expressionValue, property, type) {\r\n Object.defineProperty(expressionValue, 'velocity', {\r\n get: function get() {\r\n return property.getVelocityAtTime(property.comp.currentFrame);\r\n }\r\n });\r\n expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;\r\n\r\n expressionValue.key = function (pos) {\r\n if (!expressionValue.numKeys) {\r\n return 0;\r\n }\r\n\r\n var value = '';\r\n\r\n if ('s' in property.keyframes[pos - 1]) {\r\n value = property.keyframes[pos - 1].s;\r\n } else if ('e' in property.keyframes[pos - 2]) {\r\n value = property.keyframes[pos - 2].e;\r\n } else {\r\n value = property.keyframes[pos - 2].s;\r\n }\r\n\r\n var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers\r\n\r\n valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;\r\n valueProp.value = type === 'unidimensional' ? value[0] : value;\r\n return valueProp;\r\n };\r\n\r\n expressionValue.valueAtTime = property.getValueAtTime;\r\n expressionValue.speedAtTime = property.getSpeedAtTime;\r\n expressionValue.velocityAtTime = property.getVelocityAtTime;\r\n expressionValue.propertyGroup = property.propertyGroup;\r\n }\r\n\r\n function UnidimensionalPropertyInterface(property) {\r\n if (!property || !('pv' in property)) {\r\n property = defaultUnidimensionalValue;\r\n }\r\n\r\n var mult = 1 / property.mult;\r\n var val = property.pv * mult;\r\n var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers\r\n\r\n expressionValue.value = val;\r\n completeProperty(expressionValue, property, 'unidimensional');\r\n return function () {\r\n if (property.k) {\r\n property.getValue();\r\n }\r\n\r\n val = property.v * mult;\r\n\r\n if (expressionValue.value !== val) {\r\n expressionValue = new Number(val); // eslint-disable-line no-new-wrappers\r\n\r\n expressionValue.value = val;\r\n completeProperty(expressionValue, property, 'unidimensional');\r\n }\r\n\r\n return expressionValue;\r\n };\r\n }\r\n\r\n function MultidimensionalPropertyInterface(property) {\r\n if (!property || !('pv' in property)) {\r\n property = defaultMultidimensionalValue;\r\n }\r\n\r\n var mult = 1 / property.mult;\r\n var len = property.data && property.data.l || property.pv.length;\r\n var expressionValue = createTypedArray('float32', len);\r\n var arrValue = createTypedArray('float32', len);\r\n expressionValue.value = arrValue;\r\n completeProperty(expressionValue, property, 'multidimensional');\r\n return function () {\r\n if (property.k) {\r\n property.getValue();\r\n }\r\n\r\n for (var i = 0; i < len; i += 1) {\r\n arrValue[i] = property.v[i] * mult;\r\n expressionValue[i] = arrValue[i];\r\n }\r\n\r\n return expressionValue;\r\n };\r\n } // TODO: try to avoid using this getter\r\n\r\n\r\n function defaultGetter() {\r\n return defaultUnidimensionalValue;\r\n }\r\n\r\n return function (property) {\r\n if (!property) {\r\n return defaultGetter;\r\n }\r\n\r\n if (property.propType === 'unidimensional') {\r\n return UnidimensionalPropertyInterface(property);\r\n }\r\n\r\n return MultidimensionalPropertyInterface(property);\r\n };\r\n }();\r\n\r\n var TransformExpressionInterface = function () {\r\n return function (transform) {\r\n function _thisFunction(name) {\r\n switch (name) {\r\n case 'scale':\r\n case 'Scale':\r\n case 'ADBE Scale':\r\n case 6:\r\n return _thisFunction.scale;\r\n\r\n case 'rotation':\r\n case 'Rotation':\r\n case 'ADBE Rotation':\r\n case 'ADBE Rotate Z':\r\n case 10:\r\n return _thisFunction.rotation;\r\n\r\n case 'ADBE Rotate X':\r\n return _thisFunction.xRotation;\r\n\r\n case 'ADBE Rotate Y':\r\n return _thisFunction.yRotation;\r\n\r\n case 'position':\r\n case 'Position':\r\n case 'ADBE Position':\r\n case 2:\r\n return _thisFunction.position;\r\n\r\n case 'ADBE Position_0':\r\n return _thisFunction.xPosition;\r\n\r\n case 'ADBE Position_1':\r\n return _thisFunction.yPosition;\r\n\r\n case 'ADBE Position_2':\r\n return _thisFunction.zPosition;\r\n\r\n case 'anchorPoint':\r\n case 'AnchorPoint':\r\n case 'Anchor Point':\r\n case 'ADBE AnchorPoint':\r\n case 1:\r\n return _thisFunction.anchorPoint;\r\n\r\n case 'opacity':\r\n case 'Opacity':\r\n case 11:\r\n return _thisFunction.opacity;\r\n\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n Object.defineProperty(_thisFunction, 'rotation', {\r\n get: ExpressionPropertyInterface(transform.r || transform.rz)\r\n });\r\n Object.defineProperty(_thisFunction, 'zRotation', {\r\n get: ExpressionPropertyInterface(transform.rz || transform.r)\r\n });\r\n Object.defineProperty(_thisFunction, 'xRotation', {\r\n get: ExpressionPropertyInterface(transform.rx)\r\n });\r\n Object.defineProperty(_thisFunction, 'yRotation', {\r\n get: ExpressionPropertyInterface(transform.ry)\r\n });\r\n Object.defineProperty(_thisFunction, 'scale', {\r\n get: ExpressionPropertyInterface(transform.s)\r\n });\r\n\r\n var _px;\r\n\r\n var _py;\r\n\r\n var _pz;\r\n\r\n var _transformFactory;\r\n\r\n if (transform.p) {\r\n _transformFactory = ExpressionPropertyInterface(transform.p);\r\n } else {\r\n _px = ExpressionPropertyInterface(transform.px);\r\n _py = ExpressionPropertyInterface(transform.py);\r\n\r\n if (transform.pz) {\r\n _pz = ExpressionPropertyInterface(transform.pz);\r\n }\r\n }\r\n\r\n Object.defineProperty(_thisFunction, 'position', {\r\n get: function get() {\r\n if (transform.p) {\r\n return _transformFactory();\r\n }\r\n\r\n return [_px(), _py(), _pz ? _pz() : 0];\r\n }\r\n });\r\n Object.defineProperty(_thisFunction, 'xPosition', {\r\n get: ExpressionPropertyInterface(transform.px)\r\n });\r\n Object.defineProperty(_thisFunction, 'yPosition', {\r\n get: ExpressionPropertyInterface(transform.py)\r\n });\r\n Object.defineProperty(_thisFunction, 'zPosition', {\r\n get: ExpressionPropertyInterface(transform.pz)\r\n });\r\n Object.defineProperty(_thisFunction, 'anchorPoint', {\r\n get: ExpressionPropertyInterface(transform.a)\r\n });\r\n Object.defineProperty(_thisFunction, 'opacity', {\r\n get: ExpressionPropertyInterface(transform.o)\r\n });\r\n Object.defineProperty(_thisFunction, 'skew', {\r\n get: ExpressionPropertyInterface(transform.sk)\r\n });\r\n Object.defineProperty(_thisFunction, 'skewAxis', {\r\n get: ExpressionPropertyInterface(transform.sa)\r\n });\r\n Object.defineProperty(_thisFunction, 'orientation', {\r\n get: ExpressionPropertyInterface(transform.or)\r\n });\r\n return _thisFunction;\r\n };\r\n }();\r\n\r\n var LayerExpressionInterface = function () {\r\n function getMatrix(time) {\r\n var toWorldMat = new Matrix();\r\n\r\n if (time !== undefined) {\r\n var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);\r\n\r\n propMatrix.clone(toWorldMat);\r\n } else {\r\n var transformMat = this._elem.finalTransform.mProp;\r\n transformMat.applyToMatrix(toWorldMat);\r\n }\r\n\r\n return toWorldMat;\r\n }\r\n\r\n function toWorldVec(arr, time) {\r\n var toWorldMat = this.getMatrix(time);\r\n toWorldMat.props[12] = 0;\r\n toWorldMat.props[13] = 0;\r\n toWorldMat.props[14] = 0;\r\n return this.applyPoint(toWorldMat, arr);\r\n }\r\n\r\n function toWorld(arr, time) {\r\n var toWorldMat = this.getMatrix(time);\r\n return this.applyPoint(toWorldMat, arr);\r\n }\r\n\r\n function fromWorldVec(arr, time) {\r\n var toWorldMat = this.getMatrix(time);\r\n toWorldMat.props[12] = 0;\r\n toWorldMat.props[13] = 0;\r\n toWorldMat.props[14] = 0;\r\n return this.invertPoint(toWorldMat, arr);\r\n }\r\n\r\n function fromWorld(arr, time) {\r\n var toWorldMat = this.getMatrix(time);\r\n return this.invertPoint(toWorldMat, arr);\r\n }\r\n\r\n function applyPoint(matrix, arr) {\r\n if (this._elem.hierarchy && this._elem.hierarchy.length) {\r\n var i;\r\n var len = this._elem.hierarchy.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);\r\n }\r\n }\r\n\r\n return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);\r\n }\r\n\r\n function invertPoint(matrix, arr) {\r\n if (this._elem.hierarchy && this._elem.hierarchy.length) {\r\n var i;\r\n var len = this._elem.hierarchy.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);\r\n }\r\n }\r\n\r\n return matrix.inversePoint(arr);\r\n }\r\n\r\n function fromComp(arr) {\r\n var toWorldMat = new Matrix();\r\n toWorldMat.reset();\r\n\r\n this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);\r\n\r\n if (this._elem.hierarchy && this._elem.hierarchy.length) {\r\n var i;\r\n var len = this._elem.hierarchy.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);\r\n }\r\n\r\n return toWorldMat.inversePoint(arr);\r\n }\r\n\r\n return toWorldMat.inversePoint(arr);\r\n }\r\n\r\n function sampleImage() {\r\n return [1, 1, 1, 1];\r\n }\r\n\r\n return function (elem) {\r\n var transformInterface;\r\n\r\n function _registerMaskInterface(maskManager) {\r\n _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);\r\n }\r\n\r\n function _registerEffectsInterface(effects) {\r\n _thisLayerFunction.effect = effects;\r\n }\r\n\r\n function _thisLayerFunction(name) {\r\n switch (name) {\r\n case 'ADBE Root Vectors Group':\r\n case 'Contents':\r\n case 2:\r\n return _thisLayerFunction.shapeInterface;\r\n\r\n case 1:\r\n case 6:\r\n case 'Transform':\r\n case 'transform':\r\n case 'ADBE Transform Group':\r\n return transformInterface;\r\n\r\n case 4:\r\n case 'ADBE Effect Parade':\r\n case 'effects':\r\n case 'Effects':\r\n return _thisLayerFunction.effect;\r\n\r\n case 'ADBE Text Properties':\r\n return _thisLayerFunction.textInterface;\r\n\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n _thisLayerFunction.getMatrix = getMatrix;\r\n _thisLayerFunction.invertPoint = invertPoint;\r\n _thisLayerFunction.applyPoint = applyPoint;\r\n _thisLayerFunction.toWorld = toWorld;\r\n _thisLayerFunction.toWorldVec = toWorldVec;\r\n _thisLayerFunction.fromWorld = fromWorld;\r\n _thisLayerFunction.fromWorldVec = fromWorldVec;\r\n _thisLayerFunction.toComp = toWorld;\r\n _thisLayerFunction.fromComp = fromComp;\r\n _thisLayerFunction.sampleImage = sampleImage;\r\n _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);\r\n _thisLayerFunction._elem = elem;\r\n transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);\r\n var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');\r\n Object.defineProperties(_thisLayerFunction, {\r\n hasParent: {\r\n get: function get() {\r\n return elem.hierarchy.length;\r\n }\r\n },\r\n parent: {\r\n get: function get() {\r\n return elem.hierarchy[0].layerInterface;\r\n }\r\n },\r\n rotation: getDescriptor(transformInterface, 'rotation'),\r\n scale: getDescriptor(transformInterface, 'scale'),\r\n position: getDescriptor(transformInterface, 'position'),\r\n opacity: getDescriptor(transformInterface, 'opacity'),\r\n anchorPoint: anchorPointDescriptor,\r\n anchor_point: anchorPointDescriptor,\r\n transform: {\r\n get: function get() {\r\n return transformInterface;\r\n }\r\n },\r\n active: {\r\n get: function get() {\r\n return elem.isInRange;\r\n }\r\n }\r\n });\r\n _thisLayerFunction.startTime = elem.data.st;\r\n _thisLayerFunction.index = elem.data.ind;\r\n _thisLayerFunction.source = elem.data.refId;\r\n _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;\r\n _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;\r\n _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;\r\n _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;\r\n _thisLayerFunction._name = elem.data.nm;\r\n _thisLayerFunction.registerMaskInterface = _registerMaskInterface;\r\n _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;\r\n return _thisLayerFunction;\r\n };\r\n }();\r\n\r\n var propertyGroupFactory = function () {\r\n return function (interfaceFunction, parentPropertyGroup) {\r\n return function (val) {\r\n val = val === undefined ? 1 : val;\r\n\r\n if (val <= 0) {\r\n return interfaceFunction;\r\n }\r\n\r\n return parentPropertyGroup(val - 1);\r\n };\r\n };\r\n }();\r\n\r\n var PropertyInterface = function () {\r\n return function (propertyName, propertyGroup) {\r\n var interfaceFunction = {\r\n _name: propertyName\r\n };\r\n\r\n function _propertyGroup(val) {\r\n val = val === undefined ? 1 : val;\r\n\r\n if (val <= 0) {\r\n return interfaceFunction;\r\n }\r\n\r\n return propertyGroup(val - 1);\r\n }\r\n\r\n return _propertyGroup;\r\n };\r\n }();\r\n\r\n var EffectsExpressionInterface = function () {\r\n var ob = {\r\n createEffectsInterface: createEffectsInterface\r\n };\r\n\r\n function createEffectsInterface(elem, propertyGroup) {\r\n if (elem.effectsManager) {\r\n var effectElements = [];\r\n var effectsData = elem.data.ef;\r\n var i;\r\n var len = elem.effectsManager.effectElements.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));\r\n }\r\n\r\n var effects = elem.data.ef || [];\r\n\r\n var groupInterface = function groupInterface(name) {\r\n i = 0;\r\n len = effects.length;\r\n\r\n while (i < len) {\r\n if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {\r\n return effectElements[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n };\r\n\r\n Object.defineProperty(groupInterface, 'numProperties', {\r\n get: function get() {\r\n return effects.length;\r\n }\r\n });\r\n return groupInterface;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function createGroupInterface(data, elements, propertyGroup, elem) {\r\n function groupInterface(name) {\r\n var effects = data.ef;\r\n var i = 0;\r\n var len = effects.length;\r\n\r\n while (i < len) {\r\n if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {\r\n if (effects[i].ty === 5) {\r\n return effectElements[i];\r\n }\r\n\r\n return effectElements[i]();\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n throw new Error();\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);\r\n\r\n var effectElements = [];\r\n var i;\r\n var len = data.ef.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (data.ef[i].ty === 5) {\r\n effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));\r\n } else {\r\n effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));\r\n }\r\n }\r\n\r\n if (data.mn === 'ADBE Color Control') {\r\n Object.defineProperty(groupInterface, 'color', {\r\n get: function get() {\r\n return effectElements[0]();\r\n }\r\n });\r\n }\r\n\r\n Object.defineProperties(groupInterface, {\r\n numProperties: {\r\n get: function get() {\r\n return data.np;\r\n }\r\n },\r\n _name: {\r\n value: data.nm\r\n },\r\n propertyGroup: {\r\n value: _propertyGroup\r\n }\r\n });\r\n groupInterface.enabled = data.en !== 0;\r\n groupInterface.active = groupInterface.enabled;\r\n return groupInterface;\r\n }\r\n\r\n function createValueInterface(element, type, elem, propertyGroup) {\r\n var expressionProperty = ExpressionPropertyInterface(element.p);\r\n\r\n function interfaceFunction() {\r\n if (type === 10) {\r\n return elem.comp.compInterface(element.p.v);\r\n }\r\n\r\n return expressionProperty();\r\n }\r\n\r\n if (element.p.setGroupProperty) {\r\n element.p.setGroupProperty(PropertyInterface('', propertyGroup));\r\n }\r\n\r\n return interfaceFunction;\r\n }\r\n\r\n return ob;\r\n }();\r\n\r\n var ShapePathInterface = function () {\r\n return function pathInterfaceFactory(shape, view, propertyGroup) {\r\n var prop = view.sh;\r\n\r\n function interfaceFunction(val) {\r\n if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {\r\n return interfaceFunction.path;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));\r\n Object.defineProperties(interfaceFunction, {\r\n path: {\r\n get: function get() {\r\n if (prop.k) {\r\n prop.getValue();\r\n }\r\n\r\n return prop;\r\n }\r\n },\r\n shape: {\r\n get: function get() {\r\n if (prop.k) {\r\n prop.getValue();\r\n }\r\n\r\n return prop;\r\n }\r\n },\r\n _name: {\r\n value: shape.nm\r\n },\r\n ix: {\r\n value: shape.ix\r\n },\r\n propertyIndex: {\r\n value: shape.ix\r\n },\r\n mn: {\r\n value: shape.mn\r\n },\r\n propertyGroup: {\r\n value: propertyGroup\r\n }\r\n });\r\n return interfaceFunction;\r\n };\r\n }();\r\n\r\n var ShapeExpressionInterface = function () {\r\n function iterateElements(shapes, view, propertyGroup) {\r\n var arr = [];\r\n var i;\r\n var len = shapes ? shapes.length : 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (shapes[i].ty === 'gr') {\r\n arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'fl') {\r\n arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'st') {\r\n arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'tm') {\r\n arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'tr') {// arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));\r\n } else if (shapes[i].ty === 'el') {\r\n arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'sr') {\r\n arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'sh') {\r\n arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'rc') {\r\n arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'rd') {\r\n arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'rp') {\r\n arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else if (shapes[i].ty === 'gf') {\r\n arr.push(gradientFillInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n } else {\r\n arr.push(defaultInterfaceFactory(shapes[i], view[i], propertyGroup));\r\n }\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n function contentsInterfaceFactory(shape, view, propertyGroup) {\r\n var interfaces;\r\n\r\n var interfaceFunction = function _interfaceFunction(value) {\r\n var i = 0;\r\n var len = interfaces.length;\r\n\r\n while (i < len) {\r\n if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {\r\n return interfaces[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (typeof value === 'number') {\r\n return interfaces[value - 1];\r\n }\r\n\r\n return null;\r\n };\r\n\r\n interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);\r\n interfaceFunction.numProperties = interfaces.length;\r\n var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);\r\n interfaceFunction.transform = transformInterface;\r\n interfaceFunction.propertyIndex = shape.cix;\r\n interfaceFunction._name = shape.nm;\r\n return interfaceFunction;\r\n }\r\n\r\n function groupInterfaceFactory(shape, view, propertyGroup) {\r\n var interfaceFunction = function _interfaceFunction(value) {\r\n switch (value) {\r\n case 'ADBE Vectors Group':\r\n case 'Contents':\r\n case 2:\r\n return interfaceFunction.content;\r\n // Not necessary for now. Keeping them here in case a new case appears\r\n // case 'ADBE Vector Transform Group':\r\n // case 3:\r\n\r\n default:\r\n return interfaceFunction.transform;\r\n }\r\n };\r\n\r\n interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);\r\n var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);\r\n interfaceFunction.content = content;\r\n interfaceFunction.transform = transformInterface;\r\n Object.defineProperty(interfaceFunction, '_name', {\r\n get: function get() {\r\n return shape.nm;\r\n }\r\n }); // interfaceFunction.content = interfaceFunction;\r\n\r\n interfaceFunction.numProperties = shape.np;\r\n interfaceFunction.propertyIndex = shape.ix;\r\n interfaceFunction.nm = shape.nm;\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n function fillInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(val) {\r\n if (val === 'Color' || val === 'color') {\r\n return interfaceFunction.color;\r\n }\r\n\r\n if (val === 'Opacity' || val === 'opacity') {\r\n return interfaceFunction.opacity;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n Object.defineProperties(interfaceFunction, {\r\n color: {\r\n get: ExpressionPropertyInterface(view.c)\r\n },\r\n opacity: {\r\n get: ExpressionPropertyInterface(view.o)\r\n },\r\n _name: {\r\n value: shape.nm\r\n },\r\n mn: {\r\n value: shape.mn\r\n }\r\n });\r\n view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));\r\n view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));\r\n return interfaceFunction;\r\n }\r\n\r\n function gradientFillInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(val) {\r\n if (val === 'Start Point' || val === 'start point') {\r\n return interfaceFunction.startPoint;\r\n }\r\n\r\n if (val === 'End Point' || val === 'end point') {\r\n return interfaceFunction.endPoint;\r\n }\r\n\r\n if (val === 'Opacity' || val === 'opacity') {\r\n return interfaceFunction.opacity;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n Object.defineProperties(interfaceFunction, {\r\n startPoint: {\r\n get: ExpressionPropertyInterface(view.s)\r\n },\r\n endPoint: {\r\n get: ExpressionPropertyInterface(view.e)\r\n },\r\n opacity: {\r\n get: ExpressionPropertyInterface(view.o)\r\n },\r\n type: {\r\n get: function get() {\r\n return 'a';\r\n }\r\n },\r\n _name: {\r\n value: shape.nm\r\n },\r\n mn: {\r\n value: shape.mn\r\n }\r\n });\r\n view.s.setGroupProperty(PropertyInterface('Start Point', propertyGroup));\r\n view.e.setGroupProperty(PropertyInterface('End Point', propertyGroup));\r\n view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));\r\n return interfaceFunction;\r\n }\r\n\r\n function defaultInterfaceFactory() {\r\n function interfaceFunction() {\r\n return null;\r\n }\r\n\r\n return interfaceFunction;\r\n }\r\n\r\n function strokeInterfaceFactory(shape, view, propertyGroup) {\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);\r\n\r\n function addPropertyToDashOb(i) {\r\n Object.defineProperty(dashOb, shape.d[i].nm, {\r\n get: ExpressionPropertyInterface(view.d.dataProps[i].p)\r\n });\r\n }\r\n\r\n var i;\r\n var len = shape.d ? shape.d.length : 0;\r\n var dashOb = {};\r\n\r\n for (i = 0; i < len; i += 1) {\r\n addPropertyToDashOb(i);\r\n view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);\r\n }\r\n\r\n function interfaceFunction(val) {\r\n if (val === 'Color' || val === 'color') {\r\n return interfaceFunction.color;\r\n }\r\n\r\n if (val === 'Opacity' || val === 'opacity') {\r\n return interfaceFunction.opacity;\r\n }\r\n\r\n if (val === 'Stroke Width' || val === 'stroke width') {\r\n return interfaceFunction.strokeWidth;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n Object.defineProperties(interfaceFunction, {\r\n color: {\r\n get: ExpressionPropertyInterface(view.c)\r\n },\r\n opacity: {\r\n get: ExpressionPropertyInterface(view.o)\r\n },\r\n strokeWidth: {\r\n get: ExpressionPropertyInterface(view.w)\r\n },\r\n dash: {\r\n get: function get() {\r\n return dashOb;\r\n }\r\n },\r\n _name: {\r\n value: shape.nm\r\n },\r\n mn: {\r\n value: shape.mn\r\n }\r\n });\r\n view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));\r\n view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));\r\n view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));\r\n return interfaceFunction;\r\n }\r\n\r\n function trimInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(val) {\r\n if (val === shape.e.ix || val === 'End' || val === 'end') {\r\n return interfaceFunction.end;\r\n }\r\n\r\n if (val === shape.s.ix) {\r\n return interfaceFunction.start;\r\n }\r\n\r\n if (val === shape.o.ix) {\r\n return interfaceFunction.offset;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n interfaceFunction.propertyIndex = shape.ix;\r\n view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));\r\n view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));\r\n view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));\r\n interfaceFunction.propertyIndex = shape.ix;\r\n interfaceFunction.propertyGroup = propertyGroup;\r\n Object.defineProperties(interfaceFunction, {\r\n start: {\r\n get: ExpressionPropertyInterface(view.s)\r\n },\r\n end: {\r\n get: ExpressionPropertyInterface(view.e)\r\n },\r\n offset: {\r\n get: ExpressionPropertyInterface(view.o)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n function transformInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(value) {\r\n if (shape.a.ix === value || value === 'Anchor Point') {\r\n return interfaceFunction.anchorPoint;\r\n }\r\n\r\n if (shape.o.ix === value || value === 'Opacity') {\r\n return interfaceFunction.opacity;\r\n }\r\n\r\n if (shape.p.ix === value || value === 'Position') {\r\n return interfaceFunction.position;\r\n }\r\n\r\n if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {\r\n return interfaceFunction.rotation;\r\n }\r\n\r\n if (shape.s.ix === value || value === 'Scale') {\r\n return interfaceFunction.scale;\r\n }\r\n\r\n if (shape.sk && shape.sk.ix === value || value === 'Skew') {\r\n return interfaceFunction.skew;\r\n }\r\n\r\n if (shape.sa && shape.sa.ix === value || value === 'Skew Axis') {\r\n return interfaceFunction.skewAxis;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));\r\n view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));\r\n view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));\r\n view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));\r\n view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));\r\n\r\n if (view.transform.mProps.sk) {\r\n view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));\r\n view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));\r\n }\r\n\r\n view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));\r\n Object.defineProperties(interfaceFunction, {\r\n opacity: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.o)\r\n },\r\n position: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.p)\r\n },\r\n anchorPoint: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.a)\r\n },\r\n scale: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.s)\r\n },\r\n rotation: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.r)\r\n },\r\n skew: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.sk)\r\n },\r\n skewAxis: {\r\n get: ExpressionPropertyInterface(view.transform.mProps.sa)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.ty = 'tr';\r\n interfaceFunction.mn = shape.mn;\r\n interfaceFunction.propertyGroup = propertyGroup;\r\n return interfaceFunction;\r\n }\r\n\r\n function ellipseInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(value) {\r\n if (shape.p.ix === value) {\r\n return interfaceFunction.position;\r\n }\r\n\r\n if (shape.s.ix === value) {\r\n return interfaceFunction.size;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n interfaceFunction.propertyIndex = shape.ix;\r\n var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;\r\n prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));\r\n prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));\r\n Object.defineProperties(interfaceFunction, {\r\n size: {\r\n get: ExpressionPropertyInterface(prop.s)\r\n },\r\n position: {\r\n get: ExpressionPropertyInterface(prop.p)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n function starInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(value) {\r\n if (shape.p.ix === value) {\r\n return interfaceFunction.position;\r\n }\r\n\r\n if (shape.r.ix === value) {\r\n return interfaceFunction.rotation;\r\n }\r\n\r\n if (shape.pt.ix === value) {\r\n return interfaceFunction.points;\r\n }\r\n\r\n if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {\r\n return interfaceFunction.outerRadius;\r\n }\r\n\r\n if (shape.os.ix === value) {\r\n return interfaceFunction.outerRoundness;\r\n }\r\n\r\n if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {\r\n return interfaceFunction.innerRadius;\r\n }\r\n\r\n if (shape.is && shape.is.ix === value) {\r\n return interfaceFunction.innerRoundness;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;\r\n interfaceFunction.propertyIndex = shape.ix;\r\n prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));\r\n prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));\r\n prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));\r\n prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));\r\n prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));\r\n\r\n if (shape.ir) {\r\n prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));\r\n prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));\r\n }\r\n\r\n Object.defineProperties(interfaceFunction, {\r\n position: {\r\n get: ExpressionPropertyInterface(prop.p)\r\n },\r\n rotation: {\r\n get: ExpressionPropertyInterface(prop.r)\r\n },\r\n points: {\r\n get: ExpressionPropertyInterface(prop.pt)\r\n },\r\n outerRadius: {\r\n get: ExpressionPropertyInterface(prop.or)\r\n },\r\n outerRoundness: {\r\n get: ExpressionPropertyInterface(prop.os)\r\n },\r\n innerRadius: {\r\n get: ExpressionPropertyInterface(prop.ir)\r\n },\r\n innerRoundness: {\r\n get: ExpressionPropertyInterface(prop.is)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n function rectInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(value) {\r\n if (shape.p.ix === value) {\r\n return interfaceFunction.position;\r\n }\r\n\r\n if (shape.r.ix === value) {\r\n return interfaceFunction.roundness;\r\n }\r\n\r\n if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {\r\n return interfaceFunction.size;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;\r\n interfaceFunction.propertyIndex = shape.ix;\r\n prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));\r\n prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));\r\n prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));\r\n Object.defineProperties(interfaceFunction, {\r\n position: {\r\n get: ExpressionPropertyInterface(prop.p)\r\n },\r\n roundness: {\r\n get: ExpressionPropertyInterface(prop.r)\r\n },\r\n size: {\r\n get: ExpressionPropertyInterface(prop.s)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n function roundedInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(value) {\r\n if (shape.r.ix === value || value === 'Round Corners 1') {\r\n return interfaceFunction.radius;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n var prop = view;\r\n interfaceFunction.propertyIndex = shape.ix;\r\n prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));\r\n Object.defineProperties(interfaceFunction, {\r\n radius: {\r\n get: ExpressionPropertyInterface(prop.rd)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n function repeaterInterfaceFactory(shape, view, propertyGroup) {\r\n function interfaceFunction(value) {\r\n if (shape.c.ix === value || value === 'Copies') {\r\n return interfaceFunction.copies;\r\n }\r\n\r\n if (shape.o.ix === value || value === 'Offset') {\r\n return interfaceFunction.offset;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);\r\n\r\n var prop = view;\r\n interfaceFunction.propertyIndex = shape.ix;\r\n prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));\r\n prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));\r\n Object.defineProperties(interfaceFunction, {\r\n copies: {\r\n get: ExpressionPropertyInterface(prop.c)\r\n },\r\n offset: {\r\n get: ExpressionPropertyInterface(prop.o)\r\n },\r\n _name: {\r\n value: shape.nm\r\n }\r\n });\r\n interfaceFunction.mn = shape.mn;\r\n return interfaceFunction;\r\n }\r\n\r\n return function (shapes, view, propertyGroup) {\r\n var interfaces;\r\n\r\n function _interfaceFunction(value) {\r\n if (typeof value === 'number') {\r\n value = value === undefined ? 1 : value;\r\n\r\n if (value === 0) {\r\n return propertyGroup;\r\n }\r\n\r\n return interfaces[value - 1];\r\n }\r\n\r\n var i = 0;\r\n var len = interfaces.length;\r\n\r\n while (i < len) {\r\n if (interfaces[i]._name === value) {\r\n return interfaces[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function parentGroupWrapper() {\r\n return propertyGroup;\r\n }\r\n\r\n _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);\r\n interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);\r\n _interfaceFunction.numProperties = interfaces.length;\r\n _interfaceFunction._name = 'Contents';\r\n return _interfaceFunction;\r\n };\r\n }();\r\n\r\n var TextExpressionInterface = function () {\r\n return function (elem) {\r\n var _prevValue;\r\n\r\n var _sourceText;\r\n\r\n function _thisLayerFunction(name) {\r\n switch (name) {\r\n case 'ADBE Text Document':\r\n return _thisLayerFunction.sourceText;\r\n\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n Object.defineProperty(_thisLayerFunction, 'sourceText', {\r\n get: function get() {\r\n elem.textProperty.getValue();\r\n var stringValue = elem.textProperty.currentData.t;\r\n\r\n if (stringValue !== _prevValue) {\r\n _prevValue = elem.textProperty.currentData.t;\r\n _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers\r\n // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive\r\n\r\n _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers\r\n\r\n Object.defineProperty(_sourceText, 'style', {\r\n get: function get() {\r\n return {\r\n fillColor: elem.textProperty.currentData.fc\r\n };\r\n }\r\n });\r\n }\r\n\r\n return _sourceText;\r\n }\r\n });\r\n return _thisLayerFunction;\r\n };\r\n }();\r\n\r\n function _typeof$2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$2(obj); }\r\n\r\n var FootageInterface = function () {\r\n var outlineInterfaceFactory = function outlineInterfaceFactory(elem) {\r\n var currentPropertyName = '';\r\n var currentProperty = elem.getFootageData();\r\n\r\n function init() {\r\n currentPropertyName = '';\r\n currentProperty = elem.getFootageData();\r\n return searchProperty;\r\n }\r\n\r\n function searchProperty(value) {\r\n if (currentProperty[value]) {\r\n currentPropertyName = value;\r\n currentProperty = currentProperty[value];\r\n\r\n if (_typeof$2(currentProperty) === 'object') {\r\n return searchProperty;\r\n }\r\n\r\n return currentProperty;\r\n }\r\n\r\n var propertyNameIndex = value.indexOf(currentPropertyName);\r\n\r\n if (propertyNameIndex !== -1) {\r\n var index = parseInt(value.substr(propertyNameIndex + currentPropertyName.length), 10);\r\n currentProperty = currentProperty[index];\r\n\r\n if (_typeof$2(currentProperty) === 'object') {\r\n return searchProperty;\r\n }\r\n\r\n return currentProperty;\r\n }\r\n\r\n return '';\r\n }\r\n\r\n return init;\r\n };\r\n\r\n var dataInterfaceFactory = function dataInterfaceFactory(elem) {\r\n function interfaceFunction(value) {\r\n if (value === 'Outline') {\r\n return interfaceFunction.outlineInterface();\r\n }\r\n\r\n return null;\r\n }\r\n\r\n interfaceFunction._name = 'Outline';\r\n interfaceFunction.outlineInterface = outlineInterfaceFactory(elem);\r\n return interfaceFunction;\r\n };\r\n\r\n return function (elem) {\r\n function _interfaceFunction(value) {\r\n if (value === 'Data') {\r\n return _interfaceFunction.dataInterface;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n _interfaceFunction._name = 'Data';\r\n _interfaceFunction.dataInterface = dataInterfaceFactory(elem);\r\n return _interfaceFunction;\r\n };\r\n }();\r\n\r\n var interfaces = {\r\n layer: LayerExpressionInterface,\r\n effects: EffectsExpressionInterface,\r\n comp: CompExpressionInterface,\r\n shape: ShapeExpressionInterface,\r\n text: TextExpressionInterface,\r\n footage: FootageInterface\r\n };\r\n\r\n function getInterface(type) {\r\n return interfaces[type] || null;\r\n }\r\n\r\n function _typeof$1(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$1(obj); }\r\n\r\n /* eslint-disable */\r\n\r\n /*\r\n Copyright 2014 David Bau.\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining\r\n a copy of this software and associated documentation files (the\r\n \"Software\"), to deal in the Software without restriction, including\r\n without limitation the rights to use, copy, modify, merge, publish,\r\n distribute, sublicense, and/or sell copies of the Software, and to\r\n permit persons to whom the Software is furnished to do so, subject to\r\n the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be\r\n included in all copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n */\r\n function seedRandom(pool, math) {\r\n //\r\n // The following constants are related to IEEE 754 limits.\r\n //\r\n var global = this,\r\n width = 256,\r\n // each RC4 output is 0 <= x < 256\r\n chunks = 6,\r\n // at least six RC4 outputs for each double\r\n digits = 52,\r\n // there are 52 significant digits in a double\r\n rngname = 'random',\r\n // rngname: name for Math.random and Math.seedrandom\r\n startdenom = math.pow(width, chunks),\r\n significance = math.pow(2, digits),\r\n overflow = significance * 2,\r\n mask = width - 1,\r\n nodecrypto; // node.js crypto module, initialized at the bottom.\r\n //\r\n // seedrandom()\r\n // This is the seedrandom function described above.\r\n //\r\n\r\n function seedrandom(seed, options, callback) {\r\n var key = [];\r\n options = options === true ? {\r\n entropy: true\r\n } : options || {}; // Flatten the seed string or build one from local entropy if needed.\r\n\r\n var shortseed = mixkey(flatten(options.entropy ? [seed, tostring(pool)] : seed === null ? autoseed() : seed, 3), key); // Use the seed to initialize an ARC4 generator.\r\n\r\n var arc4 = new ARC4(key); // This function returns a random double in [0, 1) that contains\r\n // randomness in every bit of the mantissa of the IEEE 754 value.\r\n\r\n var prng = function prng() {\r\n var n = arc4.g(chunks),\r\n // Start with a numerator n < 2 ^ 48\r\n d = startdenom,\r\n // and denominator d = 2 ^ 48.\r\n x = 0; // and no 'extra last byte'.\r\n\r\n while (n < significance) {\r\n // Fill up all significant digits by\r\n n = (n + x) * width; // shifting numerator and\r\n\r\n d *= width; // denominator and generating a\r\n\r\n x = arc4.g(1); // new least-significant-byte.\r\n }\r\n\r\n while (n >= overflow) {\r\n // To avoid rounding up, before adding\r\n n /= 2; // last byte, shift everything\r\n\r\n d /= 2; // right using integer math until\r\n\r\n x >>>= 1; // we have exactly the desired bits.\r\n }\r\n\r\n return (n + x) / d; // Form the number within [0, 1).\r\n };\r\n\r\n prng.int32 = function () {\r\n return arc4.g(4) | 0;\r\n };\r\n\r\n prng.quick = function () {\r\n return arc4.g(4) / 0x100000000;\r\n };\r\n\r\n prng[\"double\"] = prng; // Mix the randomness into accumulated entropy.\r\n\r\n mixkey(tostring(arc4.S), pool); // Calling convention: what to return as a function of prng, seed, is_math.\r\n\r\n return (options.pass || callback || function (prng, seed, is_math_call, state) {\r\n if (state) {\r\n // Load the arc4 state from the given state if it has an S array.\r\n if (state.S) {\r\n copy(state, arc4);\r\n } // Only provide the .state method if requested via options.state.\r\n\r\n\r\n prng.state = function () {\r\n return copy(arc4, {});\r\n };\r\n } // If called as a method of Math (Math.seedrandom()), mutate\r\n // Math.random because that is how seedrandom.js has worked since v1.0.\r\n\r\n\r\n if (is_math_call) {\r\n math[rngname] = prng;\r\n return seed;\r\n } // Otherwise, it is a newer calling convention, so return the\r\n // prng directly.\r\n else return prng;\r\n })(prng, shortseed, 'global' in options ? options.global : this == math, options.state);\r\n }\r\n\r\n math['seed' + rngname] = seedrandom; //\r\n // ARC4\r\n //\r\n // An ARC4 implementation. The constructor takes a key in the form of\r\n // an array of at most (width) integers that should be 0 <= x < (width).\r\n //\r\n // The g(count) method returns a pseudorandom integer that concatenates\r\n // the next (count) outputs from ARC4. Its return value is a number x\r\n // that is in the range 0 <= x < (width ^ count).\r\n //\r\n\r\n function ARC4(key) {\r\n var t,\r\n keylen = key.length,\r\n me = this,\r\n i = 0,\r\n j = me.i = me.j = 0,\r\n s = me.S = []; // The empty key [] is treated as [0].\r\n\r\n if (!keylen) {\r\n key = [keylen++];\r\n } // Set up S using the standard key scheduling algorithm.\r\n\r\n\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\r\n s[j] = t;\r\n } // The \"g\" method returns the next (count) outputs as one number.\r\n\r\n\r\n me.g = function (count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t,\r\n r = 0,\r\n i = me.i,\r\n j = me.j,\r\n s = me.S;\r\n\r\n while (count--) {\r\n t = s[i = mask & i + 1];\r\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\r\n }\r\n\r\n me.i = i;\r\n me.j = j;\r\n return r; // For robust unpredictability, the function call below automatically\r\n // discards an initial batch of values. This is called RC4-drop[256].\r\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\r\n };\r\n } //\r\n // copy()\r\n // Copies internal state of ARC4 to or from a plain object.\r\n //\r\n\r\n\r\n function copy(f, t) {\r\n t.i = f.i;\r\n t.j = f.j;\r\n t.S = f.S.slice();\r\n return t;\r\n } //\r\n // flatten()\r\n // Converts an object tree to nested arrays of strings.\r\n //\r\n\r\n\r\n function flatten(obj, depth) {\r\n var result = [],\r\n typ = _typeof$1(obj),\r\n prop;\r\n\r\n if (depth && typ == 'object') {\r\n for (prop in obj) {\r\n try {\r\n result.push(flatten(obj[prop], depth - 1));\r\n } catch (e) {}\r\n }\r\n }\r\n\r\n return result.length ? result : typ == 'string' ? obj : obj + '\\0';\r\n } //\r\n // mixkey()\r\n // Mixes a string seed into a key that is an array of integers, and\r\n // returns a shortened string seed that is equivalent to the result key.\r\n //\r\n\r\n\r\n function mixkey(seed, key) {\r\n var stringseed = seed + '',\r\n smear,\r\n j = 0;\r\n\r\n while (j < stringseed.length) {\r\n key[mask & j] = mask & (smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++);\r\n }\r\n\r\n return tostring(key);\r\n } //\r\n // autoseed()\r\n // Returns an object for autoseeding, using window.crypto and Node crypto\r\n // module if available.\r\n //\r\n\r\n\r\n function autoseed() {\r\n try {\r\n if (nodecrypto) {\r\n return tostring(nodecrypto.randomBytes(width));\r\n }\r\n\r\n var out = new Uint8Array(width);\r\n (global.crypto || global.msCrypto).getRandomValues(out);\r\n return tostring(out);\r\n } catch (e) {\r\n var browser = global.navigator,\r\n plugins = browser && browser.plugins;\r\n return [+new Date(), global, plugins, global.screen, tostring(pool)];\r\n }\r\n } //\r\n // tostring()\r\n // Converts an array of charcodes to a string\r\n //\r\n\r\n\r\n function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n } //\r\n // When seedrandom.js is loaded, we immediately mix a few bits\r\n // from the built-in RNG into the entropy pool. Because we do\r\n // not want to interfere with deterministic PRNG state later,\r\n // seedrandom will not call math.random on its own again after\r\n // initialization.\r\n //\r\n\r\n\r\n mixkey(math.random(), pool); //\r\n // Nodejs and AMD support: export the implementation as a module using\r\n // either convention.\r\n //\r\n // End anonymous scope, and pass initial values.\r\n }\r\n\r\n ;\r\n\r\n function initialize$2(BMMath) {\r\n seedRandom([], BMMath);\r\n }\r\n\r\n var propTypes = {\r\n SHAPE: 'shape'\r\n };\r\n\r\n function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\r\n\r\n var ExpressionManager = function () {\r\n 'use strict';\r\n\r\n var ob = {};\r\n var Math = BMMath;\r\n var window = null;\r\n var document = null;\r\n var XMLHttpRequest = null;\r\n var fetch = null;\r\n var frames = null;\r\n initialize$2(BMMath);\r\n\r\n function $bm_isInstanceOfArray(arr) {\r\n return arr.constructor === Array || arr.constructor === Float32Array;\r\n }\r\n\r\n function isNumerable(tOfV, v) {\r\n return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;\r\n }\r\n\r\n function $bm_neg(a) {\r\n var tOfA = _typeof(a);\r\n\r\n if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {\r\n return -a;\r\n }\r\n\r\n if ($bm_isInstanceOfArray(a)) {\r\n var i;\r\n var lenA = a.length;\r\n var retArr = [];\r\n\r\n for (i = 0; i < lenA; i += 1) {\r\n retArr[i] = -a[i];\r\n }\r\n\r\n return retArr;\r\n }\r\n\r\n if (a.propType) {\r\n return a.v;\r\n }\r\n\r\n return -a;\r\n }\r\n\r\n var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;\r\n var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;\r\n var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;\r\n\r\n function sum(a, b) {\r\n var tOfA = _typeof(a);\r\n\r\n var tOfB = _typeof(b);\r\n\r\n if (tOfA === 'string' || tOfB === 'string') {\r\n return a + b;\r\n }\r\n\r\n if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {\r\n return a + b;\r\n }\r\n\r\n if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {\r\n a = a.slice(0);\r\n a[0] += b;\r\n return a;\r\n }\r\n\r\n if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {\r\n b = b.slice(0);\r\n b[0] = a + b[0];\r\n return b;\r\n }\r\n\r\n if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {\r\n var i = 0;\r\n var lenA = a.length;\r\n var lenB = b.length;\r\n var retArr = [];\r\n\r\n while (i < lenA || i < lenB) {\r\n if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {\r\n retArr[i] = a[i] + b[i];\r\n } else {\r\n retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return retArr;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n var add = sum;\r\n\r\n function sub(a, b) {\r\n var tOfA = _typeof(a);\r\n\r\n var tOfB = _typeof(b);\r\n\r\n if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {\r\n if (tOfA === 'string') {\r\n a = parseInt(a, 10);\r\n }\r\n\r\n if (tOfB === 'string') {\r\n b = parseInt(b, 10);\r\n }\r\n\r\n return a - b;\r\n }\r\n\r\n if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {\r\n a = a.slice(0);\r\n a[0] -= b;\r\n return a;\r\n }\r\n\r\n if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {\r\n b = b.slice(0);\r\n b[0] = a - b[0];\r\n return b;\r\n }\r\n\r\n if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {\r\n var i = 0;\r\n var lenA = a.length;\r\n var lenB = b.length;\r\n var retArr = [];\r\n\r\n while (i < lenA || i < lenB) {\r\n if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {\r\n retArr[i] = a[i] - b[i];\r\n } else {\r\n retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return retArr;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n function mul(a, b) {\r\n var tOfA = _typeof(a);\r\n\r\n var tOfB = _typeof(b);\r\n\r\n var arr;\r\n\r\n if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {\r\n return a * b;\r\n }\r\n\r\n var i;\r\n var len;\r\n\r\n if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {\r\n len = a.length;\r\n arr = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr[i] = a[i] * b;\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {\r\n len = b.length;\r\n arr = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr[i] = a * b[i];\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n function div(a, b) {\r\n var tOfA = _typeof(a);\r\n\r\n var tOfB = _typeof(b);\r\n\r\n var arr;\r\n\r\n if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {\r\n return a / b;\r\n }\r\n\r\n var i;\r\n var len;\r\n\r\n if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {\r\n len = a.length;\r\n arr = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr[i] = a[i] / b;\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {\r\n len = b.length;\r\n arr = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr[i] = a / b[i];\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n function mod(a, b) {\r\n if (typeof a === 'string') {\r\n a = parseInt(a, 10);\r\n }\r\n\r\n if (typeof b === 'string') {\r\n b = parseInt(b, 10);\r\n }\r\n\r\n return a % b;\r\n }\r\n\r\n var $bm_sum = sum;\r\n var $bm_sub = sub;\r\n var $bm_mul = mul;\r\n var $bm_div = div;\r\n var $bm_mod = mod;\r\n\r\n function clamp(num, min, max) {\r\n if (min > max) {\r\n var mm = max;\r\n max = min;\r\n min = mm;\r\n }\r\n\r\n return Math.min(Math.max(num, min), max);\r\n }\r\n\r\n function radiansToDegrees(val) {\r\n return val / degToRads;\r\n }\r\n\r\n var radians_to_degrees = radiansToDegrees;\r\n\r\n function degreesToRadians(val) {\r\n return val * degToRads;\r\n }\r\n\r\n var degrees_to_radians = radiansToDegrees;\r\n var helperLengthArray = [0, 0, 0, 0, 0, 0];\r\n\r\n function length(arr1, arr2) {\r\n if (typeof arr1 === 'number' || arr1 instanceof Number) {\r\n arr2 = arr2 || 0;\r\n return Math.abs(arr1 - arr2);\r\n }\r\n\r\n if (!arr2) {\r\n arr2 = helperLengthArray;\r\n }\r\n\r\n var i;\r\n var len = Math.min(arr1.length, arr2.length);\r\n var addedLength = 0;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n addedLength += Math.pow(arr2[i] - arr1[i], 2);\r\n }\r\n\r\n return Math.sqrt(addedLength);\r\n }\r\n\r\n function normalize(vec) {\r\n return div(vec, length(vec));\r\n }\r\n\r\n function rgbToHsl(val) {\r\n var r = val[0];\r\n var g = val[1];\r\n var b = val[2];\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var h;\r\n var s;\r\n var l = (max + min) / 2;\r\n\r\n if (max === min) {\r\n h = 0; // achromatic\r\n\r\n s = 0; // achromatic\r\n } else {\r\n var d = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n h /= 6;\r\n }\r\n\r\n return [h, s, l, val[3]];\r\n }\r\n\r\n function hue2rgb(p, q, t) {\r\n if (t < 0) t += 1;\r\n if (t > 1) t -= 1;\r\n if (t < 1 / 6) return p + (q - p) * 6 * t;\r\n if (t < 1 / 2) return q;\r\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\r\n return p;\r\n }\r\n\r\n function hslToRgb(val) {\r\n var h = val[0];\r\n var s = val[1];\r\n var l = val[2];\r\n var r;\r\n var g;\r\n var b;\r\n\r\n if (s === 0) {\r\n r = l; // achromatic\r\n\r\n b = l; // achromatic\r\n\r\n g = l; // achromatic\r\n } else {\r\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n r = hue2rgb(p, q, h + 1 / 3);\r\n g = hue2rgb(p, q, h);\r\n b = hue2rgb(p, q, h - 1 / 3);\r\n }\r\n\r\n return [r, g, b, val[3]];\r\n }\r\n\r\n function linear(t, tMin, tMax, value1, value2) {\r\n if (value1 === undefined || value2 === undefined) {\r\n value1 = tMin;\r\n value2 = tMax;\r\n tMin = 0;\r\n tMax = 1;\r\n }\r\n\r\n if (tMax < tMin) {\r\n var _tMin = tMax;\r\n tMax = tMin;\r\n tMin = _tMin;\r\n }\r\n\r\n if (t <= tMin) {\r\n return value1;\r\n }\r\n\r\n if (t >= tMax) {\r\n return value2;\r\n }\r\n\r\n var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);\r\n\r\n if (!value1.length) {\r\n return value1 + (value2 - value1) * perc;\r\n }\r\n\r\n var i;\r\n var len = value1.length;\r\n var arr = createTypedArray('float32', len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr[i] = value1[i] + (value2[i] - value1[i]) * perc;\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n function random(min, max) {\r\n if (max === undefined) {\r\n if (min === undefined) {\r\n min = 0;\r\n max = 1;\r\n } else {\r\n max = min;\r\n min = undefined;\r\n }\r\n }\r\n\r\n if (max.length) {\r\n var i;\r\n var len = max.length;\r\n\r\n if (!min) {\r\n min = createTypedArray('float32', len);\r\n }\r\n\r\n var arr = createTypedArray('float32', len);\r\n var rnd = BMMath.random();\r\n\r\n for (i = 0; i < len; i += 1) {\r\n arr[i] = min[i] + rnd * (max[i] - min[i]);\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n if (min === undefined) {\r\n min = 0;\r\n }\r\n\r\n var rndm = BMMath.random();\r\n return min + rndm * (max - min);\r\n }\r\n\r\n function createPath(points, inTangents, outTangents, closed) {\r\n var i;\r\n var len = points.length;\r\n var path = shapePool.newElement();\r\n path.setPathData(!!closed, len);\r\n var arrPlaceholder = [0, 0];\r\n var inVertexPoint;\r\n var outVertexPoint;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n inVertexPoint = inTangents && inTangents[i] ? inTangents[i] : arrPlaceholder;\r\n outVertexPoint = outTangents && outTangents[i] ? outTangents[i] : arrPlaceholder;\r\n path.setTripleAt(points[i][0], points[i][1], outVertexPoint[0] + points[i][0], outVertexPoint[1] + points[i][1], inVertexPoint[0] + points[i][0], inVertexPoint[1] + points[i][1], i, true);\r\n }\r\n\r\n return path;\r\n }\r\n\r\n function initiateExpression(elem, data, property) {\r\n // Bail out if we don't want expressions\r\n function noOp(_value) {\r\n return _value;\r\n }\r\n\r\n if (!elem.globalData.renderConfig.runExpressions) {\r\n return noOp;\r\n }\r\n\r\n var val = data.x;\r\n var needsVelocity = /velocity(?![\\w\\d])/.test(val);\r\n\r\n var _needsRandom = val.indexOf('random') !== -1;\r\n\r\n var elemType = elem.data.ty;\r\n var transform;\r\n var $bm_transform;\r\n var content;\r\n var effect;\r\n var thisProperty = property;\r\n thisProperty.valueAtTime = thisProperty.getValueAtTime;\r\n Object.defineProperty(thisProperty, 'value', {\r\n get: function get() {\r\n return thisProperty.v;\r\n }\r\n });\r\n elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;\r\n elem.comp.displayStartTime = 0;\r\n var inPoint = elem.data.ip / elem.comp.globalData.frameRate;\r\n var outPoint = elem.data.op / elem.comp.globalData.frameRate;\r\n var width = elem.data.sw ? elem.data.sw : 0;\r\n var height = elem.data.sh ? elem.data.sh : 0;\r\n var name = elem.data.nm;\r\n var loopIn;\r\n var loop_in;\r\n var loopOut;\r\n var loop_out;\r\n var smooth;\r\n var toWorld;\r\n var fromWorld;\r\n var fromComp;\r\n var toComp;\r\n var fromCompToSurface;\r\n var position;\r\n var rotation;\r\n var anchorPoint;\r\n var scale;\r\n var thisLayer;\r\n var thisComp;\r\n var mask;\r\n var valueAtTime;\r\n var velocityAtTime;\r\n var scoped_bm_rt; // val = val.replace(/(\\\\?\"|')((http)(s)?(:\\/))?\\/.*?(\\\\?\"|')/g, \"\\\"\\\"\"); // deter potential network calls\r\n\r\n var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval\r\n\r\n var numKeys = property.kf ? data.k.length : 0;\r\n var active = !this.data || this.data.hd !== true;\r\n\r\n var wiggle = function wiggle(freq, amp) {\r\n var iWiggle;\r\n var j;\r\n var lenWiggle = this.pv.length ? this.pv.length : 1;\r\n var addedAmps = createTypedArray('float32', lenWiggle);\r\n freq = 5;\r\n var iterations = Math.floor(time * freq);\r\n iWiggle = 0;\r\n j = 0;\r\n\r\n while (iWiggle < iterations) {\r\n // var rnd = BMMath.random();\r\n for (j = 0; j < lenWiggle; j += 1) {\r\n addedAmps[j] += -amp + amp * 2 * BMMath.random(); // addedAmps[j] += -amp + amp*2*rnd;\r\n }\r\n\r\n iWiggle += 1;\r\n } // var rnd2 = BMMath.random();\r\n\r\n\r\n var periods = time * freq;\r\n var perc = periods - Math.floor(periods);\r\n var arr = createTypedArray('float32', lenWiggle);\r\n\r\n if (lenWiggle > 1) {\r\n for (j = 0; j < lenWiggle; j += 1) {\r\n arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp * 2 * BMMath.random()) * perc; // arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp*2*rnd)*perc;\r\n // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;\r\n }.bind(this);\r\n\r\n if (thisProperty.loopIn) {\r\n loopIn = thisProperty.loopIn.bind(thisProperty);\r\n loop_in = loopIn;\r\n }\r\n\r\n if (thisProperty.loopOut) {\r\n loopOut = thisProperty.loopOut.bind(thisProperty);\r\n loop_out = loopOut;\r\n }\r\n\r\n if (thisProperty.smooth) {\r\n smooth = thisProperty.smooth.bind(thisProperty);\r\n }\r\n\r\n function loopInDuration(type, duration) {\r\n return loopIn(type, duration, true);\r\n }\r\n\r\n function loopOutDuration(type, duration) {\r\n return loopOut(type, duration, true);\r\n }\r\n\r\n if (this.getValueAtTime) {\r\n valueAtTime = this.getValueAtTime.bind(this);\r\n }\r\n\r\n if (this.getVelocityAtTime) {\r\n velocityAtTime = this.getVelocityAtTime.bind(this);\r\n }\r\n\r\n var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);\r\n\r\n function lookAt(elem1, elem2) {\r\n var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];\r\n var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;\r\n var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;\r\n return [yaw, pitch, 0];\r\n }\r\n\r\n function easeOut(t, tMin, tMax, val1, val2) {\r\n return applyEase(easeOutBez, t, tMin, tMax, val1, val2);\r\n }\r\n\r\n function easeIn(t, tMin, tMax, val1, val2) {\r\n return applyEase(easeInBez, t, tMin, tMax, val1, val2);\r\n }\r\n\r\n function ease(t, tMin, tMax, val1, val2) {\r\n return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);\r\n }\r\n\r\n function applyEase(fn, t, tMin, tMax, val1, val2) {\r\n if (val1 === undefined) {\r\n val1 = tMin;\r\n val2 = tMax;\r\n } else {\r\n t = (t - tMin) / (tMax - tMin);\r\n }\r\n\r\n if (t > 1) {\r\n t = 1;\r\n } else if (t < 0) {\r\n t = 0;\r\n }\r\n\r\n var mult = fn(t);\r\n\r\n if ($bm_isInstanceOfArray(val1)) {\r\n var iKey;\r\n var lenKey = val1.length;\r\n var arr = createTypedArray('float32', lenKey);\r\n\r\n for (iKey = 0; iKey < lenKey; iKey += 1) {\r\n arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n return (val2 - val1) * mult + val1;\r\n }\r\n\r\n function nearestKey(time) {\r\n var iKey;\r\n var lenKey = data.k.length;\r\n var index;\r\n var keyTime;\r\n\r\n if (!data.k.length || typeof data.k[0] === 'number') {\r\n index = 0;\r\n keyTime = 0;\r\n } else {\r\n index = -1;\r\n time *= elem.comp.globalData.frameRate;\r\n\r\n if (time < data.k[0].t) {\r\n index = 1;\r\n keyTime = data.k[0].t;\r\n } else {\r\n for (iKey = 0; iKey < lenKey - 1; iKey += 1) {\r\n if (time === data.k[iKey].t) {\r\n index = iKey + 1;\r\n keyTime = data.k[iKey].t;\r\n break;\r\n } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {\r\n if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {\r\n index = iKey + 2;\r\n keyTime = data.k[iKey + 1].t;\r\n } else {\r\n index = iKey + 1;\r\n keyTime = data.k[iKey].t;\r\n }\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (index === -1) {\r\n index = iKey + 1;\r\n keyTime = data.k[iKey].t;\r\n }\r\n }\r\n }\r\n\r\n var obKey = {};\r\n obKey.index = index;\r\n obKey.time = keyTime / elem.comp.globalData.frameRate;\r\n return obKey;\r\n }\r\n\r\n function key(ind) {\r\n var obKey;\r\n var iKey;\r\n var lenKey;\r\n\r\n if (!data.k.length || typeof data.k[0] === 'number') {\r\n throw new Error('The property has no keyframe at index ' + ind);\r\n }\r\n\r\n ind -= 1;\r\n obKey = {\r\n time: data.k[ind].t / elem.comp.globalData.frameRate,\r\n value: []\r\n };\r\n var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;\r\n lenKey = arr.length;\r\n\r\n for (iKey = 0; iKey < lenKey; iKey += 1) {\r\n obKey[iKey] = arr[iKey];\r\n obKey.value[iKey] = arr[iKey];\r\n }\r\n\r\n return obKey;\r\n }\r\n\r\n function framesToTime(fr, fps) {\r\n if (!fps) {\r\n fps = elem.comp.globalData.frameRate;\r\n }\r\n\r\n return fr / fps;\r\n }\r\n\r\n function timeToFrames(t, fps) {\r\n if (!t && t !== 0) {\r\n t = time;\r\n }\r\n\r\n if (!fps) {\r\n fps = elem.comp.globalData.frameRate;\r\n }\r\n\r\n return t * fps;\r\n }\r\n\r\n function seedRandom(seed) {\r\n BMMath.seedrandom(randSeed + seed);\r\n }\r\n\r\n function sourceRectAtTime() {\r\n return elem.sourceRectAtTime();\r\n }\r\n\r\n function substring(init, end) {\r\n if (typeof value === 'string') {\r\n if (end === undefined) {\r\n return value.substring(init);\r\n }\r\n\r\n return value.substring(init, end);\r\n }\r\n\r\n return '';\r\n }\r\n\r\n function substr(init, end) {\r\n if (typeof value === 'string') {\r\n if (end === undefined) {\r\n return value.substr(init);\r\n }\r\n\r\n return value.substr(init, end);\r\n }\r\n\r\n return '';\r\n }\r\n\r\n function posterizeTime(framesPerSecond) {\r\n time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;\r\n value = valueAtTime(time);\r\n }\r\n\r\n var time;\r\n var velocity;\r\n var value;\r\n var text;\r\n var textIndex;\r\n var textTotal;\r\n var selectorValue;\r\n var index = elem.data.ind;\r\n var hasParent = !!(elem.hierarchy && elem.hierarchy.length);\r\n var parent;\r\n var randSeed = Math.floor(Math.random() * 1000000);\r\n var globalData = elem.globalData;\r\n\r\n function executeExpression(_value) {\r\n // globalData.pushExpression();\r\n value = _value;\r\n\r\n if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {\r\n return value;\r\n }\r\n\r\n if (this.propType === 'textSelector') {\r\n textIndex = this.textIndex;\r\n textTotal = this.textTotal;\r\n selectorValue = this.selectorValue;\r\n }\r\n\r\n if (!thisLayer) {\r\n text = elem.layerInterface.text;\r\n thisLayer = elem.layerInterface;\r\n thisComp = elem.comp.compInterface;\r\n toWorld = thisLayer.toWorld.bind(thisLayer);\r\n fromWorld = thisLayer.fromWorld.bind(thisLayer);\r\n fromComp = thisLayer.fromComp.bind(thisLayer);\r\n toComp = thisLayer.toComp.bind(thisLayer);\r\n mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;\r\n fromCompToSurface = fromComp;\r\n }\r\n\r\n if (!transform) {\r\n transform = elem.layerInterface('ADBE Transform Group');\r\n $bm_transform = transform;\r\n\r\n if (transform) {\r\n anchorPoint = transform.anchorPoint;\r\n /* position = transform.position;\r\n rotation = transform.rotation;\r\n scale = transform.scale; */\r\n }\r\n }\r\n\r\n if (elemType === 4 && !content) {\r\n content = thisLayer('ADBE Root Vectors Group');\r\n }\r\n\r\n if (!effect) {\r\n effect = thisLayer(4);\r\n }\r\n\r\n hasParent = !!(elem.hierarchy && elem.hierarchy.length);\r\n\r\n if (hasParent && !parent) {\r\n parent = elem.hierarchy[0].layerInterface;\r\n }\r\n\r\n time = this.comp.renderedFrame / this.comp.globalData.frameRate;\r\n\r\n if (_needsRandom) {\r\n seedRandom(randSeed + time);\r\n }\r\n\r\n if (needsVelocity) {\r\n velocity = velocityAtTime(time);\r\n }\r\n\r\n expression_function();\r\n this.frameExpressionId = elem.globalData.frameId; // TODO: Check if it's possible to return on ShapeInterface the .v value\r\n // Changed this to a ternary operation because Rollup failed compiling it correctly\r\n\r\n scoped_bm_rt = scoped_bm_rt.propType === propTypes.SHAPE ? scoped_bm_rt.v : scoped_bm_rt;\r\n return scoped_bm_rt;\r\n } // Bundlers will see these as dead code and unless we reference them\r\n\r\n\r\n executeExpression.__preventDeadCodeRemoval = [$bm_transform, anchorPoint, time, velocity, inPoint, outPoint, width, height, name, loop_in, loop_out, smooth, toComp, fromCompToSurface, toWorld, fromWorld, mask, position, rotation, scale, thisComp, numKeys, active, wiggle, loopInDuration, loopOutDuration, comp, lookAt, easeOut, easeIn, ease, nearestKey, key, text, textIndex, textTotal, selectorValue, framesToTime, timeToFrames, sourceRectAtTime, substring, substr, posterizeTime, index, globalData];\r\n return executeExpression;\r\n }\r\n\r\n ob.initiateExpression = initiateExpression;\r\n ob.__preventDeadCodeRemoval = [window, document, XMLHttpRequest, fetch, frames, $bm_neg, add, $bm_sum, $bm_sub, $bm_mul, $bm_div, $bm_mod, clamp, radians_to_degrees, degreesToRadians, degrees_to_radians, normalize, rgbToHsl, hslToRgb, linear, random, createPath];\r\n return ob;\r\n }();\r\n\r\n var expressionHelpers = function () {\r\n function searchExpressions(elem, data, prop) {\r\n if (data.x) {\r\n prop.k = true;\r\n prop.x = true;\r\n prop.initiateExpression = ExpressionManager.initiateExpression;\r\n prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));\r\n }\r\n }\r\n\r\n function getValueAtTime(frameNum) {\r\n frameNum *= this.elem.globalData.frameRate;\r\n frameNum -= this.offsetTime;\r\n\r\n if (frameNum !== this._cachingAtTime.lastFrame) {\r\n this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;\r\n this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);\r\n this._cachingAtTime.lastFrame = frameNum;\r\n }\r\n\r\n return this._cachingAtTime.value;\r\n }\r\n\r\n function getSpeedAtTime(frameNum) {\r\n var delta = -0.01;\r\n var v1 = this.getValueAtTime(frameNum);\r\n var v2 = this.getValueAtTime(frameNum + delta);\r\n var speed = 0;\r\n\r\n if (v1.length) {\r\n var i;\r\n\r\n for (i = 0; i < v1.length; i += 1) {\r\n speed += Math.pow(v2[i] - v1[i], 2);\r\n }\r\n\r\n speed = Math.sqrt(speed) * 100;\r\n } else {\r\n speed = 0;\r\n }\r\n\r\n return speed;\r\n }\r\n\r\n function getVelocityAtTime(frameNum) {\r\n if (this.vel !== undefined) {\r\n return this.vel;\r\n }\r\n\r\n var delta = -0.001; // frameNum += this.elem.data.st;\r\n\r\n var v1 = this.getValueAtTime(frameNum);\r\n var v2 = this.getValueAtTime(frameNum + delta);\r\n var velocity;\r\n\r\n if (v1.length) {\r\n velocity = createTypedArray('float32', v1.length);\r\n var i;\r\n\r\n for (i = 0; i < v1.length; i += 1) {\r\n // removing frameRate\r\n // if needed, don't add it here\r\n // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);\r\n velocity[i] = (v2[i] - v1[i]) / delta;\r\n }\r\n } else {\r\n velocity = (v2 - v1) / delta;\r\n }\r\n\r\n return velocity;\r\n }\r\n\r\n function getStaticValueAtTime() {\r\n return this.pv;\r\n }\r\n\r\n function setGroupProperty(propertyGroup) {\r\n this.propertyGroup = propertyGroup;\r\n }\r\n\r\n return {\r\n searchExpressions: searchExpressions,\r\n getSpeedAtTime: getSpeedAtTime,\r\n getVelocityAtTime: getVelocityAtTime,\r\n getValueAtTime: getValueAtTime,\r\n getStaticValueAtTime: getStaticValueAtTime,\r\n setGroupProperty: setGroupProperty\r\n };\r\n }();\r\n\r\n function addPropertyDecorator() {\r\n function loopOut(type, duration, durationFlag) {\r\n if (!this.k || !this.keyframes) {\r\n return this.pv;\r\n }\r\n\r\n type = type ? type.toLowerCase() : '';\r\n var currentFrame = this.comp.renderedFrame;\r\n var keyframes = this.keyframes;\r\n var lastKeyFrame = keyframes[keyframes.length - 1].t;\r\n\r\n if (currentFrame <= lastKeyFrame) {\r\n return this.pv;\r\n }\r\n\r\n var cycleDuration;\r\n var firstKeyFrame;\r\n\r\n if (!durationFlag) {\r\n if (!duration || duration > keyframes.length - 1) {\r\n duration = keyframes.length - 1;\r\n }\r\n\r\n firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;\r\n cycleDuration = lastKeyFrame - firstKeyFrame;\r\n } else {\r\n if (!duration) {\r\n cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);\r\n } else {\r\n cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);\r\n }\r\n\r\n firstKeyFrame = lastKeyFrame - cycleDuration;\r\n }\r\n\r\n var i;\r\n var len;\r\n var ret;\r\n\r\n if (type === 'pingpong') {\r\n var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);\r\n\r\n if (iterations % 2 !== 0) {\r\n return this.getValueAtTime((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line\r\n }\r\n } else if (type === 'offset') {\r\n var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);\r\n var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);\r\n var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line\r\n\r\n var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);\r\n\r\n if (this.pv.length) {\r\n ret = new Array(initV.length);\r\n len = ret.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ret[i] = (endV[i] - initV[i]) * repeats + current[i];\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n return (endV - initV) * repeats + current;\r\n } else if (type === 'continue') {\r\n var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);\r\n var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);\r\n\r\n if (this.pv.length) {\r\n ret = new Array(lastValue.length);\r\n len = ret.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n return lastValue + (lastValue - nextLastValue) * ((currentFrame - lastKeyFrame) / 0.001);\r\n }\r\n\r\n return this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line\r\n }\r\n\r\n function loopIn(type, duration, durationFlag) {\r\n if (!this.k) {\r\n return this.pv;\r\n }\r\n\r\n type = type ? type.toLowerCase() : '';\r\n var currentFrame = this.comp.renderedFrame;\r\n var keyframes = this.keyframes;\r\n var firstKeyFrame = keyframes[0].t;\r\n\r\n if (currentFrame >= firstKeyFrame) {\r\n return this.pv;\r\n }\r\n\r\n var cycleDuration;\r\n var lastKeyFrame;\r\n\r\n if (!durationFlag) {\r\n if (!duration || duration > keyframes.length - 1) {\r\n duration = keyframes.length - 1;\r\n }\r\n\r\n lastKeyFrame = keyframes[duration].t;\r\n cycleDuration = lastKeyFrame - firstKeyFrame;\r\n } else {\r\n if (!duration) {\r\n cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);\r\n } else {\r\n cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);\r\n }\r\n\r\n lastKeyFrame = firstKeyFrame + cycleDuration;\r\n }\r\n\r\n var i;\r\n var len;\r\n var ret;\r\n\r\n if (type === 'pingpong') {\r\n var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);\r\n\r\n if (iterations % 2 === 0) {\r\n return this.getValueAtTime(((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line\r\n }\r\n } else if (type === 'offset') {\r\n var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);\r\n var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);\r\n var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0);\r\n var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;\r\n\r\n if (this.pv.length) {\r\n ret = new Array(initV.length);\r\n len = ret.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ret[i] = current[i] - (endV[i] - initV[i]) * repeats;\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n return current - (endV - initV) * repeats;\r\n } else if (type === 'continue') {\r\n var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);\r\n var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);\r\n\r\n if (this.pv.length) {\r\n ret = new Array(firstValue.length);\r\n len = ret.length;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n ret[i] = firstValue[i] + (firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame) / 0.001;\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n return firstValue + (firstValue - nextFirstValue) * (firstKeyFrame - currentFrame) / 0.001;\r\n }\r\n\r\n return this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line\r\n }\r\n\r\n function smooth(width, samples) {\r\n if (!this.k) {\r\n return this.pv;\r\n }\r\n\r\n width = (width || 0.4) * 0.5;\r\n samples = Math.floor(samples || 5);\r\n\r\n if (samples <= 1) {\r\n return this.pv;\r\n }\r\n\r\n var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;\r\n var initFrame = currentTime - width;\r\n var endFrame = currentTime + width;\r\n var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;\r\n var i = 0;\r\n var j = 0;\r\n var value;\r\n\r\n if (this.pv.length) {\r\n value = createTypedArray('float32', this.pv.length);\r\n } else {\r\n value = 0;\r\n }\r\n\r\n var sampleValue;\r\n\r\n while (i < samples) {\r\n sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);\r\n\r\n if (this.pv.length) {\r\n for (j = 0; j < this.pv.length; j += 1) {\r\n value[j] += sampleValue[j];\r\n }\r\n } else {\r\n value += sampleValue;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (this.pv.length) {\r\n for (j = 0; j < this.pv.length; j += 1) {\r\n value[j] /= samples;\r\n }\r\n } else {\r\n value /= samples;\r\n }\r\n\r\n return value;\r\n }\r\n\r\n function getTransformValueAtTime(time) {\r\n if (!this._transformCachingAtTime) {\r\n this._transformCachingAtTime = {\r\n v: new Matrix()\r\n };\r\n } /// /\r\n\r\n\r\n var matrix = this._transformCachingAtTime.v;\r\n matrix.cloneFromProps(this.pre.props);\r\n\r\n if (this.appliedTransformations < 1) {\r\n var anchor = this.a.getValueAtTime(time);\r\n matrix.translate(-anchor[0] * this.a.mult, -anchor[1] * this.a.mult, anchor[2] * this.a.mult);\r\n }\r\n\r\n if (this.appliedTransformations < 2) {\r\n var scale = this.s.getValueAtTime(time);\r\n matrix.scale(scale[0] * this.s.mult, scale[1] * this.s.mult, scale[2] * this.s.mult);\r\n }\r\n\r\n if (this.sk && this.appliedTransformations < 3) {\r\n var skew = this.sk.getValueAtTime(time);\r\n var skewAxis = this.sa.getValueAtTime(time);\r\n matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);\r\n }\r\n\r\n if (this.r && this.appliedTransformations < 4) {\r\n var rotation = this.r.getValueAtTime(time);\r\n matrix.rotate(-rotation * this.r.mult);\r\n } else if (!this.r && this.appliedTransformations < 4) {\r\n var rotationZ = this.rz.getValueAtTime(time);\r\n var rotationY = this.ry.getValueAtTime(time);\r\n var rotationX = this.rx.getValueAtTime(time);\r\n var orientation = this.or.getValueAtTime(time);\r\n matrix.rotateZ(-rotationZ * this.rz.mult).rotateY(rotationY * this.ry.mult).rotateX(rotationX * this.rx.mult).rotateZ(-orientation[2] * this.or.mult).rotateY(orientation[1] * this.or.mult).rotateX(orientation[0] * this.or.mult);\r\n }\r\n\r\n if (this.data.p && this.data.p.s) {\r\n var positionX = this.px.getValueAtTime(time);\r\n var positionY = this.py.getValueAtTime(time);\r\n\r\n if (this.data.p.z) {\r\n var positionZ = this.pz.getValueAtTime(time);\r\n matrix.translate(positionX * this.px.mult, positionY * this.py.mult, -positionZ * this.pz.mult);\r\n } else {\r\n matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);\r\n }\r\n } else {\r\n var position = this.p.getValueAtTime(time);\r\n matrix.translate(position[0] * this.p.mult, position[1] * this.p.mult, -position[2] * this.p.mult);\r\n }\r\n\r\n return matrix; /// /\r\n }\r\n\r\n function getTransformStaticValueAtTime() {\r\n return this.v.clone(new Matrix());\r\n }\r\n\r\n var getTransformProperty = TransformPropertyFactory.getTransformProperty;\r\n\r\n TransformPropertyFactory.getTransformProperty = function (elem, data, container) {\r\n var prop = getTransformProperty(elem, data, container);\r\n\r\n if (prop.dynamicProperties.length) {\r\n prop.getValueAtTime = getTransformValueAtTime.bind(prop);\r\n } else {\r\n prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);\r\n }\r\n\r\n prop.setGroupProperty = expressionHelpers.setGroupProperty;\r\n return prop;\r\n };\r\n\r\n var propertyGetProp = PropertyFactory.getProp;\r\n\r\n PropertyFactory.getProp = function (elem, data, type, mult, container) {\r\n var prop = propertyGetProp(elem, data, type, mult, container); // prop.getVelocityAtTime = getVelocityAtTime;\r\n // prop.loopOut = loopOut;\r\n // prop.loopIn = loopIn;\r\n\r\n if (prop.kf) {\r\n prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);\r\n } else {\r\n prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);\r\n }\r\n\r\n prop.setGroupProperty = expressionHelpers.setGroupProperty;\r\n prop.loopOut = loopOut;\r\n prop.loopIn = loopIn;\r\n prop.smooth = smooth;\r\n prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);\r\n prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);\r\n prop.numKeys = data.a === 1 ? data.k.length : 0;\r\n prop.propertyIndex = data.ix;\r\n var value = 0;\r\n\r\n if (type !== 0) {\r\n value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);\r\n }\r\n\r\n prop._cachingAtTime = {\r\n lastFrame: initialDefaultFrame,\r\n lastIndex: 0,\r\n value: value\r\n };\r\n expressionHelpers.searchExpressions(elem, data, prop);\r\n\r\n if (prop.k) {\r\n container.addDynamicProperty(prop);\r\n }\r\n\r\n return prop;\r\n };\r\n\r\n function getShapeValueAtTime(frameNum) {\r\n // For now this caching object is created only when needed instead of creating it when the shape is initialized.\r\n if (!this._cachingAtTime) {\r\n this._cachingAtTime = {\r\n shapeValue: shapePool.clone(this.pv),\r\n lastIndex: 0,\r\n lastTime: initialDefaultFrame\r\n };\r\n }\r\n\r\n frameNum *= this.elem.globalData.frameRate;\r\n frameNum -= this.offsetTime;\r\n\r\n if (frameNum !== this._cachingAtTime.lastTime) {\r\n this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;\r\n this._cachingAtTime.lastTime = frameNum;\r\n this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);\r\n }\r\n\r\n return this._cachingAtTime.shapeValue;\r\n }\r\n\r\n var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();\r\n var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();\r\n\r\n function ShapeExpressions() {}\r\n\r\n ShapeExpressions.prototype = {\r\n vertices: function vertices(prop, time) {\r\n if (this.k) {\r\n this.getValue();\r\n }\r\n\r\n var shapePath = this.v;\r\n\r\n if (time !== undefined) {\r\n shapePath = this.getValueAtTime(time, 0);\r\n }\r\n\r\n var i;\r\n var len = shapePath._length;\r\n var vertices = shapePath[prop];\r\n var points = shapePath.v;\r\n var arr = createSizedArray(len);\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (prop === 'i' || prop === 'o') {\r\n arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];\r\n } else {\r\n arr[i] = [vertices[i][0], vertices[i][1]];\r\n }\r\n }\r\n\r\n return arr;\r\n },\r\n points: function points(time) {\r\n return this.vertices('v', time);\r\n },\r\n inTangents: function inTangents(time) {\r\n return this.vertices('i', time);\r\n },\r\n outTangents: function outTangents(time) {\r\n return this.vertices('o', time);\r\n },\r\n isClosed: function isClosed() {\r\n return this.v.c;\r\n },\r\n pointOnPath: function pointOnPath(perc, time) {\r\n var shapePath = this.v;\r\n\r\n if (time !== undefined) {\r\n shapePath = this.getValueAtTime(time, 0);\r\n }\r\n\r\n if (!this._segmentsLength) {\r\n this._segmentsLength = bez.getSegmentsLength(shapePath);\r\n }\r\n\r\n var segmentsLength = this._segmentsLength;\r\n var lengths = segmentsLength.lengths;\r\n var lengthPos = segmentsLength.totalLength * perc;\r\n var i = 0;\r\n var len = lengths.length;\r\n var accumulatedLength = 0;\r\n var pt;\r\n\r\n while (i < len) {\r\n if (accumulatedLength + lengths[i].addedLength > lengthPos) {\r\n var initIndex = i;\r\n var endIndex = shapePath.c && i === len - 1 ? 0 : i + 1;\r\n var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;\r\n pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);\r\n break;\r\n } else {\r\n accumulatedLength += lengths[i].addedLength;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n if (!pt) {\r\n pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];\r\n }\r\n\r\n return pt;\r\n },\r\n vectorOnPath: function vectorOnPath(perc, time, vectorType) {\r\n // perc doesn't use triple equality because it can be a Number object as well as a primitive.\r\n if (perc == 1) {\r\n // eslint-disable-line eqeqeq\r\n perc = this.v.c;\r\n } else if (perc == 0) {\r\n // eslint-disable-line eqeqeq\r\n perc = 0.999;\r\n }\r\n\r\n var pt1 = this.pointOnPath(perc, time);\r\n var pt2 = this.pointOnPath(perc + 0.001, time);\r\n var xLength = pt2[0] - pt1[0];\r\n var yLength = pt2[1] - pt1[1];\r\n var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));\r\n\r\n if (magnitude === 0) {\r\n return [0, 0];\r\n }\r\n\r\n var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];\r\n return unitVector;\r\n },\r\n tangentOnPath: function tangentOnPath(perc, time) {\r\n return this.vectorOnPath(perc, time, 'tangent');\r\n },\r\n normalOnPath: function normalOnPath(perc, time) {\r\n return this.vectorOnPath(perc, time, 'normal');\r\n },\r\n setGroupProperty: expressionHelpers.setGroupProperty,\r\n getValueAtTime: expressionHelpers.getStaticValueAtTime\r\n };\r\n extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);\r\n extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);\r\n KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;\r\n KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;\r\n var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;\r\n\r\n ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {\r\n var prop = propertyGetShapeProp(elem, data, type, arr, trims);\r\n prop.propertyIndex = data.ix;\r\n prop.lock = false;\r\n\r\n if (type === 3) {\r\n expressionHelpers.searchExpressions(elem, data.pt, prop);\r\n } else if (type === 4) {\r\n expressionHelpers.searchExpressions(elem, data.ks, prop);\r\n }\r\n\r\n if (prop.k) {\r\n elem.addDynamicProperty(prop);\r\n }\r\n\r\n return prop;\r\n };\r\n }\r\n\r\n function initialize$1() {\r\n addPropertyDecorator();\r\n }\r\n\r\n function addDecorator() {\r\n function searchExpressions() {\r\n if (this.data.d.x) {\r\n this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);\r\n this.addEffect(this.getExpressionValue.bind(this));\r\n return true;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n TextProperty.prototype.getExpressionValue = function (currentValue, text) {\r\n var newValue = this.calculateExpression(text);\r\n\r\n if (currentValue.t !== newValue) {\r\n var newData = {};\r\n this.copyData(newData, currentValue);\r\n newData.t = newValue.toString();\r\n newData.__complete = false;\r\n return newData;\r\n }\r\n\r\n return currentValue;\r\n };\r\n\r\n TextProperty.prototype.searchProperty = function () {\r\n var isKeyframed = this.searchKeyframes();\r\n var hasExpressions = this.searchExpressions();\r\n this.kf = isKeyframed || hasExpressions;\r\n return this.kf;\r\n };\r\n\r\n TextProperty.prototype.searchExpressions = searchExpressions;\r\n }\r\n\r\n function initialize() {\r\n addDecorator();\r\n }\r\n\r\n function SVGComposableEffect() {}\r\n\r\n SVGComposableEffect.prototype = {\r\n createMergeNode: function createMergeNode(resultId, ins) {\r\n var feMerge = createNS('feMerge');\r\n feMerge.setAttribute('result', resultId);\r\n var feMergeNode;\r\n var i;\r\n\r\n for (i = 0; i < ins.length; i += 1) {\r\n feMergeNode = createNS('feMergeNode');\r\n feMergeNode.setAttribute('in', ins[i]);\r\n feMerge.appendChild(feMergeNode);\r\n feMerge.appendChild(feMergeNode);\r\n }\r\n\r\n return feMerge;\r\n }\r\n };\r\n\r\n var linearFilterValue = '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0';\r\n\r\n function SVGTintFilter(filter, filterManager, elem, id, source) {\r\n this.filterManager = filterManager;\r\n var feColorMatrix = createNS('feColorMatrix');\r\n feColorMatrix.setAttribute('type', 'matrix');\r\n feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');\r\n feColorMatrix.setAttribute('values', linearFilterValue + ' 1 0');\r\n this.linearFilter = feColorMatrix;\r\n feColorMatrix.setAttribute('result', id + '_tint_1');\r\n filter.appendChild(feColorMatrix);\r\n feColorMatrix = createNS('feColorMatrix');\r\n feColorMatrix.setAttribute('type', 'matrix');\r\n feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');\r\n feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');\r\n feColorMatrix.setAttribute('result', id + '_tint_2');\r\n filter.appendChild(feColorMatrix);\r\n this.matrixFilter = feColorMatrix;\r\n var feMerge = this.createMergeNode(id, [source, id + '_tint_1', id + '_tint_2']);\r\n filter.appendChild(feMerge);\r\n }\r\n\r\n extendPrototype([SVGComposableEffect], SVGTintFilter);\r\n\r\n SVGTintFilter.prototype.renderFrame = function (forceRender) {\r\n if (forceRender || this.filterManager._mdf) {\r\n var colorBlack = this.filterManager.effectElements[0].p.v;\r\n var colorWhite = this.filterManager.effectElements[1].p.v;\r\n var opacity = this.filterManager.effectElements[2].p.v / 100;\r\n this.linearFilter.setAttribute('values', linearFilterValue + ' ' + opacity + ' 0');\r\n this.matrixFilter.setAttribute('values', colorWhite[0] - colorBlack[0] + ' 0 0 0 ' + colorBlack[0] + ' ' + (colorWhite[1] - colorBlack[1]) + ' 0 0 0 ' + colorBlack[1] + ' ' + (colorWhite[2] - colorBlack[2]) + ' 0 0 0 ' + colorBlack[2] + ' 0 0 0 1 0');\r\n }\r\n };\r\n\r\n function SVGFillFilter(filter, filterManager, elem, id) {\r\n this.filterManager = filterManager;\r\n var feColorMatrix = createNS('feColorMatrix');\r\n feColorMatrix.setAttribute('type', 'matrix');\r\n feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');\r\n feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');\r\n feColorMatrix.setAttribute('result', id);\r\n filter.appendChild(feColorMatrix);\r\n this.matrixFilter = feColorMatrix;\r\n }\r\n\r\n SVGFillFilter.prototype.renderFrame = function (forceRender) {\r\n if (forceRender || this.filterManager._mdf) {\r\n var color = this.filterManager.effectElements[2].p.v;\r\n var opacity = this.filterManager.effectElements[6].p.v;\r\n this.matrixFilter.setAttribute('values', '0 0 0 0 ' + color[0] + ' 0 0 0 0 ' + color[1] + ' 0 0 0 0 ' + color[2] + ' 0 0 0 ' + opacity + ' 0');\r\n }\r\n };\r\n\r\n function SVGStrokeEffect(fil, filterManager, elem) {\r\n this.initialized = false;\r\n this.filterManager = filterManager;\r\n this.elem = elem;\r\n this.paths = [];\r\n }\r\n\r\n SVGStrokeEffect.prototype.initialize = function () {\r\n var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;\r\n var path;\r\n var groupPath;\r\n var i;\r\n var len;\r\n\r\n if (this.filterManager.effectElements[1].p.v === 1) {\r\n len = this.elem.maskManager.masksProperties.length;\r\n i = 0;\r\n } else {\r\n i = this.filterManager.effectElements[0].p.v - 1;\r\n len = i + 1;\r\n }\r\n\r\n groupPath = createNS('g');\r\n groupPath.setAttribute('fill', 'none');\r\n groupPath.setAttribute('stroke-linecap', 'round');\r\n groupPath.setAttribute('stroke-dashoffset', 1);\r\n\r\n for (i; i < len; i += 1) {\r\n path = createNS('path');\r\n groupPath.appendChild(path);\r\n this.paths.push({\r\n p: path,\r\n m: i\r\n });\r\n }\r\n\r\n if (this.filterManager.effectElements[10].p.v === 3) {\r\n var mask = createNS('mask');\r\n var id = createElementID();\r\n mask.setAttribute('id', id);\r\n mask.setAttribute('mask-type', 'alpha');\r\n mask.appendChild(groupPath);\r\n this.elem.globalData.defs.appendChild(mask);\r\n var g = createNS('g');\r\n g.setAttribute('mask', 'url(' + getLocationHref() + '#' + id + ')');\r\n\r\n while (elemChildren[0]) {\r\n g.appendChild(elemChildren[0]);\r\n }\r\n\r\n this.elem.layerElement.appendChild(g);\r\n this.masker = mask;\r\n groupPath.setAttribute('stroke', '#fff');\r\n } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {\r\n if (this.filterManager.effectElements[10].p.v === 2) {\r\n elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;\r\n\r\n while (elemChildren.length) {\r\n this.elem.layerElement.removeChild(elemChildren[0]);\r\n }\r\n }\r\n\r\n this.elem.layerElement.appendChild(groupPath);\r\n this.elem.layerElement.removeAttribute('mask');\r\n groupPath.setAttribute('stroke', '#fff');\r\n }\r\n\r\n this.initialized = true;\r\n this.pathMasker = groupPath;\r\n };\r\n\r\n SVGStrokeEffect.prototype.renderFrame = function (forceRender) {\r\n if (!this.initialized) {\r\n this.initialize();\r\n }\r\n\r\n var i;\r\n var len = this.paths.length;\r\n var mask;\r\n var path;\r\n\r\n for (i = 0; i < len; i += 1) {\r\n if (this.paths[i].m !== -1) {\r\n mask = this.elem.maskManager.viewData[this.paths[i].m];\r\n path = this.paths[i].p;\r\n\r\n if (forceRender || this.filterManager._mdf || mask.prop._mdf) {\r\n path.setAttribute('d', mask.lastPath);\r\n }\r\n\r\n if (forceRender || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || mask.prop._mdf) {\r\n var dasharrayValue;\r\n\r\n if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {\r\n var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;\r\n var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;\r\n var l = path.getTotalLength();\r\n dasharrayValue = '0 0 0 ' + l * s + ' ';\r\n var lineLength = l * (e - s);\r\n var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;\r\n var units = Math.floor(lineLength / segment);\r\n var j;\r\n\r\n for (j = 0; j < units; j += 1) {\r\n dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';\r\n }\r\n\r\n dasharrayValue += '0 ' + l * 10 + ' 0 0';\r\n } else {\r\n dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;\r\n }\r\n\r\n path.setAttribute('stroke-dasharray', dasharrayValue);\r\n }\r\n }\r\n }\r\n\r\n if (forceRender || this.filterManager.effectElements[4].p._mdf) {\r\n this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);\r\n }\r\n\r\n if (forceRender || this.filterManager.effectElements[6].p._mdf) {\r\n this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);\r\n }\r\n\r\n if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {\r\n if (forceRender || this.filterManager.effectElements[3].p._mdf) {\r\n var color = this.filterManager.effectElements[3].p.v;\r\n this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');\r\n }\r\n }\r\n };\r\n\r\n function SVGTritoneFilter(filter, filterManager, elem, id) {\r\n this.filterManager = filterManager;\r\n var feColorMatrix = createNS('feColorMatrix');\r\n feColorMatrix.setAttribute('type', 'matrix');\r\n feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');\r\n feColorMatrix.setAttribute('values', '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');\r\n filter.appendChild(feColorMatrix);\r\n var feComponentTransfer = createNS('feComponentTransfer');\r\n feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');\r\n feComponentTransfer.setAttribute('result', id);\r\n this.matrixFilter = feComponentTransfer;\r\n var feFuncR = createNS('feFuncR');\r\n feFuncR.setAttribute('type', 'table');\r\n feComponentTransfer.appendChild(feFuncR);\r\n this.feFuncR = feFuncR;\r\n var feFuncG = createNS('feFuncG');\r\n feFuncG.setAttribute('type', 'table');\r\n feComponentTransfer.appendChild(feFuncG);\r\n this.feFuncG = feFuncG;\r\n var feFuncB = createNS('feFuncB');\r\n feFuncB.setAttribute('type', 'table');\r\n feComponentTransfer.appendChild(feFuncB);\r\n this.feFuncB = feFuncB;\r\n filter.appendChild(feComponentTransfer);\r\n }\r\n\r\n SVGTritoneFilter.prototype.renderFrame = function (forceRender) {\r\n if (forceRender || this.filterManager._mdf) {\r\n var color1 = this.filterManager.effectElements[0].p.v;\r\n var color2 = this.filterManager.effectElements[1].p.v;\r\n var color3 = this.filterManager.effectElements[2].p.v;\r\n var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];\r\n var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];\r\n var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];\r\n this.feFuncR.setAttribute('tableValues', tableR);\r\n this.feFuncG.setAttribute('tableValues', tableG);\r\n this.feFuncB.setAttribute('tableValues', tableB);\r\n }\r\n };\r\n\r\n function SVGProLevelsFilter(filter, filterManager, elem, id) {\r\n this.filterManager = filterManager;\r\n var effectElements = this.filterManager.effectElements;\r\n var feComponentTransfer = createNS('feComponentTransfer'); // Red\r\n\r\n if (effectElements[10].p.k || effectElements[10].p.v !== 0 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 1 || effectElements[13].p.k || effectElements[13].p.v !== 0 || effectElements[14].p.k || effectElements[14].p.v !== 1) {\r\n this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);\r\n } // Green\r\n\r\n\r\n if (effectElements[17].p.k || effectElements[17].p.v !== 0 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 1 || effectElements[20].p.k || effectElements[20].p.v !== 0 || effectElements[21].p.k || effectElements[21].p.v !== 1) {\r\n this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);\r\n } // Blue\r\n\r\n\r\n if (effectElements[24].p.k || effectElements[24].p.v !== 0 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 1 || effectElements[27].p.k || effectElements[27].p.v !== 0 || effectElements[28].p.k || effectElements[28].p.v !== 1) {\r\n this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);\r\n } // Alpha\r\n\r\n\r\n if (effectElements[31].p.k || effectElements[31].p.v !== 0 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 1 || effectElements[34].p.k || effectElements[34].p.v !== 0 || effectElements[35].p.k || effectElements[35].p.v !== 1) {\r\n this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);\r\n } // RGB\r\n\r\n\r\n if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {\r\n feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');\r\n filter.appendChild(feComponentTransfer);\r\n }\r\n\r\n if (effectElements[3].p.k || effectElements[3].p.v !== 0 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 1 || effectElements[6].p.k || effectElements[6].p.v !== 0 || effectElements[7].p.k || effectElements[7].p.v !== 1) {\r\n feComponentTransfer = createNS('feComponentTransfer');\r\n feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');\r\n feComponentTransfer.setAttribute('result', id);\r\n filter.appendChild(feComponentTransfer);\r\n this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);\r\n this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);\r\n this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);\r\n }\r\n }\r\n\r\n SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {\r\n var feFunc = createNS(type);\r\n feFunc.setAttribute('type', 'table');\r\n feComponentTransfer.appendChild(feFunc);\r\n return feFunc;\r\n };\r\n\r\n SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {\r\n var cnt = 0;\r\n var segments = 256;\r\n var perc;\r\n var min = Math.min(inputBlack, inputWhite);\r\n var max = Math.max(inputBlack, inputWhite);\r\n var table = Array.call(null, {\r\n length: segments\r\n });\r\n var colorValue;\r\n var pos = 0;\r\n var outputDelta = outputWhite - outputBlack;\r\n var inputDelta = inputWhite - inputBlack;\r\n\r\n while (cnt <= 256) {\r\n perc = cnt / 256;\r\n\r\n if (perc <= min) {\r\n colorValue = inputDelta < 0 ? outputWhite : outputBlack;\r\n } else if (perc >= max) {\r\n colorValue = inputDelta < 0 ? outputBlack : outputWhite;\r\n } else {\r\n colorValue = outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma);\r\n }\r\n\r\n table[pos] = colorValue;\r\n pos += 1;\r\n cnt += 256 / (segments - 1);\r\n }\r\n\r\n return table.join(' ');\r\n };\r\n\r\n SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {\r\n if (forceRender || this.filterManager._mdf) {\r\n var val;\r\n var effectElements = this.filterManager.effectElements;\r\n\r\n if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {\r\n val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);\r\n this.feFuncRComposed.setAttribute('tableValues', val);\r\n this.feFuncGComposed.setAttribute('tableValues', val);\r\n this.feFuncBComposed.setAttribute('tableValues', val);\r\n }\r\n\r\n if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {\r\n val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);\r\n this.feFuncR.setAttribute('tableValues', val);\r\n }\r\n\r\n if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {\r\n val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);\r\n this.feFuncG.setAttribute('tableValues', val);\r\n }\r\n\r\n if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {\r\n val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);\r\n this.feFuncB.setAttribute('tableValues', val);\r\n }\r\n\r\n if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {\r\n val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);\r\n this.feFuncA.setAttribute('tableValues', val);\r\n }\r\n }\r\n };\r\n\r\n function SVGDropShadowEffect(filter, filterManager, elem, id, source) {\r\n var globalFilterSize = filterManager.container.globalData.renderConfig.filterSize;\r\n var filterSize = filterManager.data.fs || globalFilterSize;\r\n filter.setAttribute('x', filterSize.x || globalFilterSize.x);\r\n filter.setAttribute('y', filterSize.y || globalFilterSize.y);\r\n filter.setAttribute('width', filterSize.width || globalFilterSize.width);\r\n filter.setAttribute('height', filterSize.height || globalFilterSize.height);\r\n this.filterManager = filterManager;\r\n var feGaussianBlur = createNS('feGaussianBlur');\r\n feGaussianBlur.setAttribute('in', 'SourceAlpha');\r\n feGaussianBlur.setAttribute('result', id + '_drop_shadow_1');\r\n feGaussianBlur.setAttribute('stdDeviation', '0');\r\n this.feGaussianBlur = feGaussianBlur;\r\n filter.appendChild(feGaussianBlur);\r\n var feOffset = createNS('feOffset');\r\n feOffset.setAttribute('dx', '25');\r\n feOffset.setAttribute('dy', '0');\r\n feOffset.setAttribute('in', id + '_drop_shadow_1');\r\n feOffset.setAttribute('result', id + '_drop_shadow_2');\r\n this.feOffset = feOffset;\r\n filter.appendChild(feOffset);\r\n var feFlood = createNS('feFlood');\r\n feFlood.setAttribute('flood-color', '#00ff00');\r\n feFlood.setAttribute('flood-opacity', '1');\r\n feFlood.setAttribute('result', id + '_drop_shadow_3');\r\n this.feFlood = feFlood;\r\n filter.appendChild(feFlood);\r\n var feComposite = createNS('feComposite');\r\n feComposite.setAttribute('in', id + '_drop_shadow_3');\r\n feComposite.setAttribute('in2', id + '_drop_shadow_2');\r\n feComposite.setAttribute('operator', 'in');\r\n feComposite.setAttribute('result', id + '_drop_shadow_4');\r\n filter.appendChild(feComposite);\r\n var feMerge = this.createMergeNode(id, [id + '_drop_shadow_4', source]);\r\n filter.appendChild(feMerge); //\r\n }\r\n\r\n extendPrototype([SVGComposableEffect], SVGDropShadowEffect);\r\n\r\n SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {\r\n if (forceRender || this.filterManager._mdf) {\r\n if (forceRender || this.filterManager.effectElements[4].p._mdf) {\r\n this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);\r\n }\r\n\r\n if (forceRender || this.filterManager.effectElements[0].p._mdf) {\r\n var col = this.filterManager.effectElements[0].p.v;\r\n this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));\r\n }\r\n\r\n if (forceRender || this.filterManager.effectElements[1].p._mdf) {\r\n this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);\r\n }\r\n\r\n if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {\r\n var distance = this.filterManager.effectElements[3].p.v;\r\n var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;\r\n var x = distance * Math.cos(angle);\r\n var y = distance * Math.sin(angle);\r\n this.feOffset.setAttribute('dx', x);\r\n this.feOffset.setAttribute('dy', y);\r\n }\r\n }\r\n };\r\n\r\n var _svgMatteSymbols = [];\r\n\r\n function SVGMatte3Effect(filterElem, filterManager, elem) {\r\n this.initialized = false;\r\n this.filterManager = filterManager;\r\n this.filterElem = filterElem;\r\n this.elem = elem;\r\n elem.matteElement = createNS('g');\r\n elem.matteElement.appendChild(elem.layerElement);\r\n elem.matteElement.appendChild(elem.transformedElement);\r\n elem.baseElement = elem.matteElement;\r\n }\r\n\r\n SVGMatte3Effect.prototype.findSymbol = function (mask) {\r\n var i = 0;\r\n var len = _svgMatteSymbols.length;\r\n\r\n while (i < len) {\r\n if (_svgMatteSymbols[i] === mask) {\r\n return _svgMatteSymbols[i];\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n return null;\r\n };\r\n\r\n SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {\r\n var parentNode = mask.layerElement.parentNode;\r\n\r\n if (!parentNode) {\r\n return;\r\n }\r\n\r\n var children = parentNode.children;\r\n var i = 0;\r\n var len = children.length;\r\n\r\n while (i < len) {\r\n if (children[i] === mask.layerElement) {\r\n break;\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n var nextChild;\r\n\r\n if (i <= len - 2) {\r\n nextChild = children[i + 1];\r\n }\r\n\r\n var useElem = createNS('use');\r\n useElem.setAttribute('href', '#' + symbolId);\r\n\r\n if (nextChild) {\r\n parentNode.insertBefore(useElem, nextChild);\r\n } else {\r\n parentNode.appendChild(useElem);\r\n }\r\n };\r\n\r\n SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {\r\n if (!this.findSymbol(mask)) {\r\n var symbolId = createElementID();\r\n var masker = createNS('mask');\r\n masker.setAttribute('id', mask.layerId);\r\n masker.setAttribute('mask-type', 'alpha');\r\n\r\n _svgMatteSymbols.push(mask);\r\n\r\n var defs = elem.globalData.defs;\r\n defs.appendChild(masker);\r\n var symbol = createNS('symbol');\r\n symbol.setAttribute('id', symbolId);\r\n this.replaceInParent(mask, symbolId);\r\n symbol.appendChild(mask.layerElement);\r\n defs.appendChild(symbol);\r\n var useElem = createNS('use');\r\n useElem.setAttribute('href', '#' + symbolId);\r\n masker.appendChild(useElem);\r\n mask.data.hd = false;\r\n mask.show();\r\n }\r\n\r\n elem.setMatte(mask.layerId);\r\n };\r\n\r\n SVGMatte3Effect.prototype.initialize = function () {\r\n var ind = this.filterManager.effectElements[0].p.v;\r\n var elements = this.elem.comp.elements;\r\n var i = 0;\r\n var len = elements.length;\r\n\r\n while (i < len) {\r\n if (elements[i] && elements[i].data.ind === ind) {\r\n this.setElementAsMask(this.elem, elements[i]);\r\n }\r\n\r\n i += 1;\r\n }\r\n\r\n this.initialized = true;\r\n };\r\n\r\n SVGMatte3Effect.prototype.renderFrame = function () {\r\n if (!this.initialized) {\r\n this.initialize();\r\n }\r\n };\r\n\r\n function SVGGaussianBlurEffect(filter, filterManager, elem, id) {\r\n // Outset the filter region by 100% on all sides to accommodate blur expansion.\r\n filter.setAttribute('x', '-100%');\r\n filter.setAttribute('y', '-100%');\r\n filter.setAttribute('width', '300%');\r\n filter.setAttribute('height', '300%');\r\n this.filterManager = filterManager;\r\n var feGaussianBlur = createNS('feGaussianBlur');\r\n feGaussianBlur.setAttribute('result', id);\r\n filter.appendChild(feGaussianBlur);\r\n this.feGaussianBlur = feGaussianBlur;\r\n }\r\n\r\n SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {\r\n if (forceRender || this.filterManager._mdf) {\r\n // Empirical value, matching AE's blur appearance.\r\n var kBlurrinessToSigma = 0.3;\r\n var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma; // Dimensions mapping:\r\n //\r\n // 1 -> horizontal & vertical\r\n // 2 -> horizontal only\r\n // 3 -> vertical only\r\n //\r\n\r\n var dimensions = this.filterManager.effectElements[1].p.v;\r\n var sigmaX = dimensions == 3 ? 0 : sigma; // eslint-disable-line eqeqeq\r\n\r\n var sigmaY = dimensions == 2 ? 0 : sigma; // eslint-disable-line eqeqeq\r\n\r\n this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY); // Repeat edges mapping:\r\n //\r\n // 0 -> off -> duplicate\r\n // 1 -> on -> wrap\r\n\r\n var edgeMode = this.filterManager.effectElements[2].p.v == 1 ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq\r\n\r\n this.feGaussianBlur.setAttribute('edgeMode', edgeMode);\r\n }\r\n };\r\n\r\n registerRenderer('canvas', CanvasRenderer);\r\n registerRenderer('html', HybridRenderer);\r\n registerRenderer('svg', SVGRenderer); // Registering shape modifiers\r\n\r\n ShapeModifiers.registerModifier('tm', TrimModifier);\r\n ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);\r\n ShapeModifiers.registerModifier('rp', RepeaterModifier);\r\n ShapeModifiers.registerModifier('rd', RoundCornersModifier);\r\n ShapeModifiers.registerModifier('zz', ZigZagModifier);\r\n ShapeModifiers.registerModifier('op', OffsetPathModifier); // Registering expression plugin\r\n\r\n setExpressionsPlugin(Expressions);\r\n setExpressionInterfaces(getInterface);\r\n initialize$1();\r\n initialize(); // Registering svg effects\r\n\r\n registerEffect(20, SVGTintFilter, true);\r\n registerEffect(21, SVGFillFilter, true);\r\n registerEffect(22, SVGStrokeEffect, false);\r\n registerEffect(23, SVGTritoneFilter, true);\r\n registerEffect(24, SVGProLevelsFilter, true);\r\n registerEffect(25, SVGDropShadowEffect, true);\r\n registerEffect(28, SVGMatte3Effect, false);\r\n registerEffect(29, SVGGaussianBlurEffect, true);\r\n\r\n return lottie;\r\n\r\n}));\r\n"],"names":["factory","navigator","svgNS","locationHref","_useWebWorker","initialDefaultFrame","setWebWorker","flag","getWebWorker","setLocationHref","value","getLocationHref","createTag","type","document","createElement","extendPrototype","sources","destination","i","sourcePrototype","len","length","attr","prototype","Object","hasOwnProperty","call","getDescriptor","object","prop","getOwnPropertyDescriptor","createProxyFunction","ProxyFunction","audioControllerFactory","AudioController","audioFactory","this","audios","_volume","_isMuted","addAudio","audio","push","pause","resume","setRate","rateValue","createAudio","assetPath","window","Howl","src","isPlaying","play","seek","playing","rate","setVolume","setAudioFactory","_updateVolume","mute","unmute","getVolume","volume","createTypedArray","createRegularArray","arr","Uint8ClampedArray","Float32Array","Int16Array","createSizedArray","Array","apply","_typeof$6","obj","Symbol","iterator","constructor","subframeEnabled","expressionsPlugin","expressionsInterfaces","idPrefix$1","isSafari","test","userAgent","_shouldRoundValues","bmPow","Math","pow","bmSqrt","sqrt","bmFloor","floor","bmMax","max","bmMin","min","BMMath","ProjectInterface$1","propertyNames","random","abs","val","absArr","defaultCurveSegments","degToRads","PI","roundCorner","roundValues","bmRnd","round","styleDiv","element","style","position","top","left","display","transformOrigin","webkitTransformOrigin","backfaceVisibility","webkitBackfaceVisibility","transformStyle","webkitTransformStyle","mozTransformStyle","BMEnterFrameEvent","currentTime","totalTime","frameMultiplier","direction","BMCompleteEvent","BMCompleteLoopEvent","totalLoops","currentLoop","BMSegmentStartEvent","firstFrame","totalFrames","BMDestroyEvent","target","BMRenderFrameErrorEvent","nativeError","BMConfigErrorEvent","BMAnimationConfigErrorEvent","createElementID","_count","HSVtoRGB","h","s","v","r","g","b","f","p","q","t","RGBtoHSV","d","addSaturationToRGB","color","offset","hsv","addBrightnessToRGB","addHueToRGB","rgbToHex","hex","colorMap","toString","setSubframeEnabled","getSubframeEnabled","setExpressionsPlugin","getExpressionsPlugin","setExpressionInterfaces","getExpressionInterfaces","setDefaultCurveSegments","getDefaultCurveSegments","setIdPrefix","getIdPrefix","createNS","createElementNS","_typeof$5","dataManager","workerFn","workerInstance","_counterId","processes","workerProxy","onmessage","postMessage","path","data","_workerSelf","setupWorker","fn","Worker","Blob","blob","url","URL","createObjectURL","createWorker","e","completeLayers","layers","comps","layerData","j","jLen","k","kLen","completed","hasMask","maskProps","masksProperties","pt","convertPathsToAbsoluteValues","ty","findCompLayers","refId","completeShapes","shapes","completeText","id","comp","findComp","__used","JSON","parse","stringify","ks","it","o","checkVersion","minimum","animVersionString","animVersion","split","checkText","minimumVersion","updateTextLayer","textLayer","documentData","iterateLayers","animationData","assets","checkChars","chars","charData","ip","op","st","sr","a","sk","sa","checkPathProperties","pathData","checkColors","iterateShapes","c","checkShapes","completeClosingShapes","closed","cl","moduleOb","__complete","completeChars","dataFunctionManager","assetLoader","formatResponse","xhr","contentTypeHeader","getResponseHeader","responseType","indexOf","response","responseText","load","fullPath","callback","errorCallback","XMLHttpRequest","err","onreadystatechange","readyState","status","open","join","error","send","completeData","payload","animation","event","process","onComplete","onError","createProcess","loadAnimation","processId","location","origin","pathname","loadData","completeAnimation","anim","ImagePreloader","proxyImage","canvas","width","height","ctx","getContext","fillStyle","fillRect","imageLoaded","loadedAssets","totalImages","loadedFootagesCount","totalFootages","imagesLoadedCb","footageLoaded","getAssetsPath","assetData","assetsPath","originalPath","imagePath","u","testImageLoaded","img","intervalId","setInterval","getBBox","_imageLoaded","clearInterval","bind","createFootageData","ob","footageData","_footageLoaded","ImagePreloaderFactory","images","loadAssets","cb","_createImageData","setAssetsPath","setPath","loadedImages","loadedFootages","destroy","getAsset","createImgData","crossOrigin","addEventListener","createImageData","setAttributeNS","_elementHelper","append","appendChild","setCacheType","elementHelper","BaseEvent","triggerEvent","eventName","args","_cbs","callbacks","removeEventListener","splice","markerParser","parsePayloadLines","line","lines","keys","keysCount","trim","Error","_markers","markers","_marker","markerData","time","tm","duration","dr","cm","_","__","name","ProjectInterface","registerComposition","compositions","_thisProjectFunction","nm","prepareFrame","xt","currentFrame","compInterface","renderers","registerRenderer","key","getRenderer","_typeof$4","AnimationItem","isLoaded","currentRawFrame","frameRate","frameMult","playSpeed","playDirection","playCount","isPaused","autoplay","loop","renderer","animationID","timeCompleted","segmentPos","isSubframeEnabled","segments","_idle","_completedLoop","projectInterface","imagePreloader","audioController","configAnimation","onSetupError","onSegmentComplete","drawnFrameEvent","setParams","params","wrapper","container","animType","RendererClass","rendererSettings","globalData","defs","setProjectInterface","undefined","parseInt","autoloadSegments","initialSegment","setupAnimation","lastIndexOf","substr","fileName","trigger","setData","wrapperAttributes","attributes","getNamedItem","prerender","includeLayers","newLayers","fonts","fontManager","addChars","addFonts","initExpressions","loadNextSegment","segment","shift","segmentPath","loadSegments","imagesLoaded","checkLoaded","preloadImages","animData","fr","searchExtraCompositions","updaFrameModifier","waitForFontsLoaded","triggerConfigError","setTimeout","rendererType","initItems","gotoFrame","resize","_width","_height","updateContainerSize","setSubframe","renderFrame","triggerRenderFrameError","togglePause","stop","setCurrentRawFrameValue","getMarkerData","markerName","marker","goToAndStop","isFrame","numValue","Number","isNaN","frameModifier","goToAndPlay","playSegments","advanceTime","nextValue","_isComplete","checkSegments","adjustSegment","setSpeed","setDirection","setSegment","init","end","pendingFrame","forceFlag","resetSegments","onEnterFrame","onLoopComplete","onSegmentStart","onDestroy","setLoop","isLooping","getPath","getAssetData","hide","show","getDuration","updateDocumentData","index","getElementByPath","animationManager","registeredAnimations","initTime","playingAnimationsNum","_stopped","_isFrozen","removeElement","ev","animItem","subtractPlayingCount","registerAnimation","elem","addPlayingCount","activate","nowTime","elapsedTime","requestAnimationFrame","first","searchAnimations","standalone","animElements","concat","slice","getElementsByClassName","lenAnims","setAttribute","body","getElementsByTagName","innerText","div","freeze","unfreeze","getRegisteredAnimations","animations","BezierFactory","str","replace","beziers","bezEasing","BezierEasing","kSampleStepSize","float32ArraySupported","A","aA1","aA2","B","C","calcBezier","aT","getSlope","points","_p","_mSampleValues","_precomputed","get","x","mX1","mY1","mX2","mY2","_precompute","_getTForX","_calcSampleValues","aX","mSampleValues","intervalStart","currentSample","kSplineTableSize","guessForT","initialSlope","aGuessT","currentSlope","newtonRaphsonIterate","aA","aB","currentX","currentT","binarySubdivide","pooling","poolFactory","initialLength","_create","_release","_length","_maxLength","pool","newElement","release","bezierLengthPool","addedLength","percents","lengths","segmentsLengthPool","totalLength","bezFunction","math","pointOnLine2D","x1","y1","x2","y2","x3","y3","det1","getBezierLength","pt1","pt2","pt3","pt4","ptCoord","perc","ptDistance","curveSegments","point","lastPoint","lengthData","BezierData","segmentLength","PointData","partial","partialLength","buildBezierData","storedData","bezierName","bezierData","getDistancePerc","initPos","lengthPos","lPerc","dir","bezierSegmentPoints","getSegmentsLength","shapeData","segmentsLength","pathV","pathO","pathI","getNewSegment","startPerc","endPerc","t0","t1","u0","u1","u0u0u0","t0u0u0_3","t0t0u0_3","t0t0t0","u0u0u1","t0u0u1_3","t0t0u1_3","t0t0t1","u0u1u1","t0u1u1_3","t0t1u1_3","t0t1t1","u1u1u1","t1u1u1_3","t1t1u1_3","t1t1t1","getPointInSegment","percent","pointOnLine3D","z1","z2","z3","diffDist","dist1","dist2","dist3","bez","PropertyFactory","initFrame","mathAbs","interpolateValue","frameNum","caching","newValue","offsetTime","propType","pv","keyData","nextKeyData","keyframeMetadata","fnc","iterationIndex","lastIndex","keyframes","keyframesMetadata","endValue","nextKeyTime","keyTime","to","ti","ind","__fnct","getBezierEasing","y","n","segmentPerc","distanceInLine","lastFrame","_lastKeyframeIndex","_lastAddedLength","_lastPoint","outX","outY","inX","inY","keyValue","sh","out","quat","qx","qy","qz","qw","heading","atan2","attitude","asin","bank","quaternionToEuler","omega","cosom","sinom","scale0","scale1","ax","ay","az","aw","bx","by","bz","bw","acos","sin","slerp","createQuaternion","values","c1","cos","c2","c3","s1","s2","s3","getValueAtCurrentTime","renderedFrame","endTime","_caching","renderResult","setVValue","multipliedValue","mult","_mdf","processEffectsSequence","frameId","effectsSequence","lock","_isFirstFrame","finalValue","kf","addEffect","effectFunction","addDynamicProperty","ValueProperty","vel","getValue","MultiDimensionalProperty","KeyframedValueProperty","KeyframedMultidimensionalProperty","arrLen","getProp","DynamicPropertyContainer","dynamicProperties","_isAnimated","iterateDynamicProperties","initDynamicPropertyContainer","pointPool","ShapePath","setPathData","setLength","doubleArrayLength","setXYAt","pos","setTripleAt","vX","vY","oX","oY","iX","iY","reverse","newPath","vertices","outPoints","inPoints","cnt","shapePool","shapePath","clone","shape","cloned","ShapeCollection","addShape","releaseShapes","shapeCollectionPool","newShapeCollection","shapeCollection","ShapePropertyFactory","interpolateShape","previousValue","keyPropS","keyPropE","isHold","vertexValue","interpolateShapeCurrentTime","resetShape","paths","localShapeCollection","shape1","shape2","shapesEqual","ShapeProperty","reset","KeyframedShapeProperty","EllShapeProperty","cPoint","EllShapePropertyFactory","convertEllToPath","p0","p1","s0","_cw","_v","StarShapeProperty","StarShapePropertyFactory","sy","ir","is","convertToPath","convertStarToPath","convertPolygonToPath","or","os","rad","roundness","perimSegment","numPts","angle","longFlag","longRad","shortRad","longRound","shortRound","longPerimSegment","shortPerimSegment","currentAng","ox","oy","RectShapeProperty","RectShapePropertyFactory","convertRectToPath","v0","v1","Matrix","_cos","_sin","_tan","tan","_rnd","props","rotate","mCos","mSin","_t","rotateX","rotateY","rotateZ","shear","sx","skew","skewFromAxis","scale","sz","setTransform","l","m","translate","tx","tz","transform","a2","b2","d2","e2","f2","g2","h2","i2","j2","k2","l2","m2","n2","o2","p2","_identityCalculated","a1","b1","d1","e1","f1","g1","h1","i1","j1","k1","l1","m1","n1","o1","isIdentity","_identity","equals","matr","cloneFromProps","applyToPoint","z","applyToX","applyToY","applyToZ","getInverseMatrix","determinant","inverseMatrix","inversePoint","applyToPointArray","inversePoints","pts","retPts","applyToTriplePoints","p4","p5","p12","p13","applyToPointStringified","toCSS","cssValue","roundMatrixProperty","to2dCSS","_typeof$3","lottie","setLocation","href","setSubframeRendering","setPrefix","prefix","setQuality","inBrowser","installPlugin","plugin","getFactory","checkReady","readyStateCheckInterval","getQueryVariable","variable","vars","queryString","pair","decodeURIComponent","useWebWorker","setIDPrefix","__getFactory","version","scripts","myScript","exports","ShapeModifiers","modifiers","registerModifier","getModifier","ShapeModifier","TrimModifier","PuckerAndBloatModifier","initModifierProperties","addShapeToModifier","setAsAnimated","processKeys","sValue","eValue","pathsData","calculateShapeEdges","shapeLength","totalModifierLength","segmentOb","shapeSegments","shapeS","shapeE","releasePathsData","processShapes","shapePaths","_s","totalShapeLength","edges","newShapesData","addShapes","lastShape","pop","addPaths","newPaths","addSegment","newShape","addSegmentFromArray","shapeSegment","currentLengthData","segmentCount","amount","processPath","centerPoint","pathLength","clonedPath","TransformPropertyFactory","defaultVector","TransformProperty","pre","appliedTransformations","px","py","pz","rx","ry","rz","_isDirty","applyToMatrix","mat","forceRender","precalculateMatrix","autoOriented","v2","getValueAtTime","autoOrient","_addDynamicProperty","getTransformProperty","RepeaterModifier","RoundCornersModifier","floatEqual","floatZero","lerp","lerpPoint","quadRoots","singleRoot","delta","polynomialCoefficients","p3","singlePoint","PolynomialBezier","linearize","pointEqual","coeffx","coeffy","extrema","intersectData","t2","box","boundingBox","cx","cy","splitData","boxIntersect","intersectsImpl","depth","tolerance","intersections","maxRecursion","d1s","d2s","crossProduct","lineIntersection","start1","end1","start2","end2","v3","v4","polarOffset","pointDistance","hypot","ZigZagModifier","setPoint","outputBezier","amplitude","outAmplitude","inAmplitude","angO","angI","getPerpendicularVector","vector","rot","getProjectingAngle","cur","prevIndex","nextIndex","pVector","zigZagCorner","frequency","pointType","prevPoint","nextPoint","prevDist","nextDist","zigZagSegment","dist","normalAngle","linearOffset","offsetSegment","p1a","p1b","p2b","p2a","joinLines","seg1","seg2","lineJoin","miterLimit","angleOut","tangentAngle","angleIn","center","radius","intersection","getIntersection","intersect","pruneSegmentIntersection","outa","outb","pruneIntersections","offsetSegmentSplit","right","mid","flex","inflectionPoints","OffsetPathModifier","getFontProperties","fontData","styles","fStyle","fWeight","toLowerCase","weight","tr","so","eo","pMatrix","rMatrix","sMatrix","tMatrix","matrix","applyTransforms","inv","scaleX","scaleY","elemsData","_currentCopies","_elements","_groups","unshift","resetElements","elements","_processed","cloneElements","newElements","changeGroupRender","renderFlag","_render","items","itemsTransform","cont","hasReloaded","copies","ceil","group","ix","reloadShapes","elems","transformData","offsetModulo","roundOffset","pProps","rProps","sProps","iteration","mProps","rd","currentV","currentI","currentO","closerV","distance","newPosPerc","derivative","denom","tcusp","square","root","filter","p10","p11","p20","p21","bounds","bottom","other","shapeSegmentInverted","pointsType","count","ml","lj","inputBezier","multiSegments","lastSeg","multiSegment","FontManager","emptyChar","w","size","combinedCharacters","surrogateModifiers","zeroWidthJoiner","setUpNode","font","family","parentNode","fontFamily","node","fontSize","fontVariant","fontStyle","fontWeight","letterSpacing","offsetWidth","familyArray","enabledFamilies","trimFontOptions","parent","createHelper","def","helper","engine","fontProps","tHelper","fFamily","textContent","fClass","tCanvasHelper","OffscreenCanvas","measureText","text","getComputedTextLength","Font","typekitLoaded","_warned","Date","now","setIsLoadedBinded","setIsLoaded","checkLoadedFontsBinded","checkLoadedFonts","isModifier","firstCharCode","secondCharCode","sum","isZeroWidthJoiner","isCombinedCharacter","_char3","fontPrototype","found","ch","list","forEach","cache","fontArr","_pendingFonts","loadedSelector","shouldLoadFont","loaded","monoCase","sansCase","fPath","fOrigin","querySelectorAll","rel","sc","getCharData","_char","charCodeAt","console","warn","getFontByName","fName","_char2","fontName","doubleSize","singleSize","loadedCount","removeChild","RenderableElement","initRenderable","isInRange","hidden","isTransparent","renderableComponents","addRenderableComponent","component","removeRenderableComponent","prepareRenderableFrame","num","checkLayerLimits","checkTransparency","finalTransform","mProp","renderConfig","hideOnTransparent","renderRenderable","sourceRectAtTime","getLayerSize","textData","getBlendMode","blendModeEnums","mode","SliderEffect","AngleEffect","ColorEffect","PointEffect","LayerIndexEffect","MaskIndexEffect","CheckboxEffect","NoValueEffect","EffectsManager","effects","ef","effectElements","effectItem","GroupEffect","BaseElement","FrameElement","FootageElement","imageLoader","initBaseData","AudioElement","_isPlaying","_canPlay","_currentTime","_volumeMultiplier","_previousVolume","_placeholder","lv","au","BaseRenderer","TransformElement","MaskElement","maskElement","viewData","solidPath","rect","expansor","feMorph","properties","currentMasks","layerId","maskType","maskRef","getShapeProp","lastPath","filterID","expan","lastOperator","filterId","lastRadius","mask","createLayerSolidPath","invRect","drawPath","maskedElement","eff","checkMasks","LayerExpressionInterface","EffectsExpressionInterface","ShapeExpressionInterface","TextExpressionInterface","CompExpressionInterface","layerInterface","maskManager","registerMaskInterface","effectsInterface","createEffectsInterface","registerEffectsInterface","shapeInterface","shapesData","itemsData","content","textInterface","setBlendMode","blendModeValue","bm","baseElement","layerElement","effectsManager","getType","prepareProperties","isVisible","_isParent","getBaseElement","FootageInterface","getFootageData","timeRemapped","totalVolume","volumeValue","checkLayers","buildItem","checkPendingElements","createItem","layer","createImage","createComp","createSolid","createNull","createShape","createText","createCamera","createFootage","buildAllItems","pInterface","progressiveLoad","buildElementParenting","parentName","hierarchy","setAsParent","setHierarchy","addPendingElement","pendingElements","getElementById","pathValue","setupGlobalData","fontsContainer","animationItem","compSize","initTransform","_matMdf","_opMdf","ao","renderTransform","finalMat","globalToLocal","transforms","ptNew","mHelper","getMaskProperty","isFirstFrame","getMaskelement","pathNodes","pathString","pathShapeValue","filtersFactory","filId","skipCoordinates","fil","feColorMatrix","featureSupport","svgLumaHidden","offscreenCanvas","registeredEffects","idPrefix","SVGEffects","filterManager","source","createFilter","filters","Effect","effect","countsAsEffect","registerEffect","SVGBaseElement","HierarchyElement","RenderableDOMElement","IImageElement","initElement","sourceRect","ProcessedElement","IShapeElement","initRendererElement","createContainerElements","matteElement","transformedElement","_sizeChanged","layerElementParent","td","matteMasks","gg","tt","ln","hd","cp","clipId","cpGroup","renderElement","destroyBaseElement","createRenderableComponents","renderableEffectsManager","getMatte","matteType","useElement","masker","createAlphaToLuminanceFilter","maskGroup","maskGrouper","feCTr","feFunc","alphaRect","setMatte","initHierarchy","checkParenting","createContent","renderInnerContent","innerElem","pr","imagePreserveAspectRatio","addShapeToModifiers","shapeModifiers","isShapeInAnimatedModifiers","isAnimatedWithShape","renderModifiers","searchProcessedElement","processedElements","addProcessedElement","lineCapEnum","lineJoinEnum","SVGShapeData","transformers","level","caches","lStr","lvl","SVGStyleData","pElem","msElem","DashProperty","dataProps","dashStr","dashArray","dashoffset","SVGStrokeStyleData","styleOb","SVGFillStyleData","SVGNoStyleData","GradientProperty","cLength","_cmdf","_omdf","_collapsable","checkCollapsable","_hasOpacity","SVGGradientFillStyleData","initGradientData","SVGGradientStrokeStyleData","ShapeGroupData","prevViewData","gr","SVGTransformData","comparePoints","stops","setGradientData","setGradientOpacity","pathElement","gradientId","gfill","gf","cst","opacityId","maskId","opFill","lc","of","ms","ost","buildShapeString","_o","_i","shapeString","SVGElementsRenderer","_identityMatrix","_matrixHelper","renderContentTransform","styleData","itemData","renderNoop","renderPath","pathStringTransformed","redraw","iterations","lLen","renderFill","styleElem","renderGradientStroke","renderGradient","renderStroke","hasOpacity","attr1","attr2","cValues","oValues","ang","createRenderFunction","SVGShapeElement","stylesList","animatedContents","LetterProps","sw","fc","TextProperty","_frameId","keysIndex","canResize","minimumFontSize","currentData","ascent","boxWidth","defaultBoxWidth","justifyOffset","lh","lineWidths","ls","ps","fillColorAnim","strokeColorAnim","strokeWidthAnim","yOffset","finalSize","finalText","finalLineHeight","copyData","searchProperty","completeTextData","initSecondaryElement","identityMatrix","buildExpressionInterface","searchShapes","filterUniqueShapes","tempShapes","areAnimated","setShapesAsAnimated","createStyleElement","elementData","addToAnimatedContents","createGroupElement","createTransformElement","transformProperty","createShapeElement","ownTransformers","setElementStyles","render","currentTransform","modifier","processedPos","ownStyles","ownModifiers","renderShape","animatedContent","update","updated","setCurrentData","searchKeyframes","getKeyframeValue","_finalValue","currentValue","currentIndex","textKeys","buildFinalText","charCode","charactersArray","shouldCombine","charAt","newLineFlag","letters","anchorGrouping","currentSize","currentPos","currentLine","lineWidth","maxLineWidth","trackingOffset","currentHeight","boxHeight","lastSpaceIndex","currentChar","uncollapsedSpaces","an","add","anIndexes","animatorJustifyOffset","extra","animatorData","letterData","based","animators","indexes","fh","fs","fb","rn","totalChars","newInd","currentInd","newData","dData","recalculate","canResizeFont","_canResize","setMinimumFontSize","_fontValue","TextSelectorProp","TextSelectorPropFactory","_currentTextLength","finalS","finalE","xe","ne","sm","getMult","textProperty","easer","tot","smoothness","threshold","newCharsFlag","divisor","getTextSelectorProp","TextAnimatorDataProperty","animatorProps","defaultData","textAnimatorAnimatables","TextAnimatorProperty","renderType","_hasMaskedPath","_textData","_renderType","_elem","_animatorsData","_pathData","_moreOptions","alignment","renderedLetters","lettersChangedFlag","ITextElement","searchProperties","getMeasures","xPos","yPos","pathInfo","currentLength","currentPoint","pointInd","segmentInd","tanAngle","matrixHelper","renderedLettersCount","tLength","pi","letterValue","yOff","firstLine","offf","xPathPos","yPathPos","elemOpacity","letterSw","letterSc","letterFc","letterO","initPathPos","initSegmentInd","initPointInd","letterM","letterP","defaultPropsArray","animatorFirstCharOffset","justifyOffsetMult","isNewLine","animatorOffset","atan","textAnimator","buildNewText","createPathShape","shapeStr","_fontSize","applyTextPropertiesToMatrix","lineNumber","buildColor","colorData","emptyProp","emptyShapeData","SVGTextLottieElement","textSpans","ISolidElement","NullElement","SVGRendererBase","ICompElement","SVGCompElement","supports3d","SVGRenderer","config","svgElement","ariaLabel","title","titleElement","titleId","description","descElement","descId","preserveAspectRatio","contentVisibility","viewBoxOnly","viewBoxSize","className","focusable","filterSize","runExpressions","destroyed","CVContextData","saved","cArrPos","cTr","cO","savedOp","ShapeTransformManager","sequences","sequenceList","transform_key_count","singleShape","textContainer","buildTextContents","textArray","textContents","currentTextContent","String","fromCharCode","buildShapeData","shapeItem","tSpan","usesGlyphs","cachedSpansLength","span","childSpan","glyph","glyphElement","_debug","tElement","justify","textBox","bbox","renderedLetter","textSpan","findIndexByInd","appendElementInPos","elementIndex","tp","matteMask","nextElement","insertBefore","setElements","getElements","destroyElements","duplicate","newLength","currentSavedOp","set","popTransform","popped","popOpacity","opacity","getTransform","getOpacity","setOpacity","addTransformSequence","sequence","processSequence","processSequences","getNewKey","lumaLoader","lumaBuffer","lumaBufferCtx","svg","loadLuma","_svg","createLumaSvgFilter","createCanvas","loadLumaCanvas","getLumaCanvas","CVEffects","CVMaskElement","hasMasks","CVBaseElement","canvasContext","beginPath","moveTo","lineTo","bezierCurveTo","save","clip","operationsMap","CVShapeData","transformsManager","styledShapes","styledShape","trNodes","CVShapeElement","CVTextElement","stroke","fill","currentRender","sWidth","fValue","CVImageElement","CVSolidElement","CanvasRendererBase","clearCanvas","context","dpr","devicePixelRatio","currentGlobalAlpha","contextData","transformMat","CVCompElement","CanvasRenderer","HBaseElement","HSolidElement","HShapeElement","shapesContainer","currentBBox","HTextElement","textPaths","isMasked","HCameraElement","pe","_prevMat","HImageElement","HybridRendererBase","threeDElements","camera","HCompElement","HybridRenderer","createElements","buffers","bufferCanvas","bufferCanvas2","_isProxy","transformCanvas","blendMode","globalCompositeOperation","hideElement","showElement","clearRect","prepareLayer","bufferCtx","drawImage","exitLayer","buffer","forceRealStack","ctxTransform","ctxOpacity","restore","transformHelper","dashResetter","preTransforms","co","wi","da","addTransformToStyleList","removeTransformFromStyleList","closeStyles","shouldRender","ownTransforms","_shouldRender","renderShapeTransform","parentTransform","groupTransform","drawLayer","nodes","currentStyle","coOp","strokeStyle","grd","lineCap","setLineDash","lineDashOffset","closePath","isMain","renderGradientFill","renderStyledShape","shapeNodes","groupTransformMat","createLinearGradient","createRadialGradient","addColorStop","hasFill","hasStroke","commands","pathArr","commandsCounter","lastFill","lastStroke","lastStrokeW","widthCrop","heightCrop","imgW","imgH","imgRel","canvasRel","par","cProps","trProps","currentOpacity","globalAlpha","actionFlag","containerStyle","mozTransformOrigin","isDashed","elementWidth","elementHeight","elementRel","animationRel","offsetHeight","fillType","checkBlendMode","tg","transformedElementStyle","matrixValue","webkitTransform","addEffects","backgroundColor","_renderShapeFrame","shapeCont","getTransformedPoint","calculateShapeBoundingBox","item","vPoint","oPoint","nextIPoint","nextVPoint","checkBounds","getBoundsOfCurve","shapeBoundingBox","xMax","yMax","tempBoundingBox","b2ac","calculateF","calculateBoundingBox","expandStrokeBoundingBox","widthProperty","kfw","currentBoxContains","changed","shapeStyle","shapeTransform","compW","compH","innerElemStyle","textColor","strokeWidth","lineHeight","tParent","tCont","children","tContStyle","tContTranslation","tStyle","tSpanTranslation","svgStyle","translation","textPath","margin","svgTransform","setup","perspectiveStyle","perspectiveElem","perspective","webkitPerspective","mTransf","diffVector","mag","lookDir","lookLengthOnXZ","mRotationX","mRotationY","hasMatrixChanged","matValue","Image","imageElem","newDOMElement","ddd","addTo3dContainer","nextDOMElement","nextLayer","getThreeDContainerByPos","startPos","endPos","createThreeDContainer","threeDContainerData","build3dContainers","lastThreeDContainerData","currentContainer","resizerElem","overflow","cWidth","cHeight","floatingContainer","_createBaseContainerElements","_thisLayerFunction","defineProperty","pixelAspect","frameDuration","displayStartTime","numLayers","Expressions","stackCount","registers","pushExpression","popExpression","releaseInstances","registerExpressionProperty","expression","MaskManagerInterface","MaskInterface","_mask","_data","_masksInterfaces","ExpressionPropertyInterface","defaultUnidimensionalValue","defaultMultidimensionalValue","completeProperty","expressionValue","property","getVelocityAtTime","numKeys","valueProp","assign","valueAtTime","speedAtTime","getSpeedAtTime","velocityAtTime","propertyGroup","defaultGetter","UnidimensionalPropertyInterface","arrValue","MultidimensionalPropertyInterface","TransformExpressionInterface","_thisFunction","rotation","xRotation","yRotation","xPosition","yPosition","zPosition","anchorPoint","_px","_py","_pz","_transformFactory","getMatrix","toWorldMat","toWorldVec","applyPoint","toWorld","fromWorldVec","invertPoint","fromWorld","fromComp","sampleImage","transformInterface","toComp","anchorPointDescriptor","defineProperties","hasParent","anchor_point","active","startTime","inPoint","outPoint","_name","propertyGroupFactory","interfaceFunction","parentPropertyGroup","PropertyInterface","propertyName","createGroupInterface","groupInterface","mn","_propertyGroup","createValueInterface","numProperties","np","enabled","en","expressionProperty","setGroupProperty","effectsData","ShapePathInterface","view","propertyIndex","iterateElements","groupInterfaceFactory","fillInterfaceFactory","strokeInterfaceFactory","trimInterfaceFactory","ellipseInterfaceFactory","starInterfaceFactory","rectInterfaceFactory","roundedInterfaceFactory","repeaterInterfaceFactory","gradientFillInterfaceFactory","interfaces","transformInterfaceFactory","cix","contentsInterfaceFactory","startPoint","endPoint","_dashPropertyGroup","dashOb","addPropertyToDashOb","dash","start","skewAxis","outerRadius","outerRoundness","innerRoundness","innerRadius","_interfaceFunction","_prevValue","_sourceText","sourceText","stringValue","fillColor","_typeof$2","dataInterfaceFactory","outlineInterface","currentPropertyName","currentProperty","propertyNameIndex","outlineInterfaceFactory","dataInterface","footage","getInterface","_typeof$1","seedRandom","global","startdenom","significance","ARC4","keylen","me","S","copy","flatten","result","typ","mixkey","seed","smear","stringseed","tostring","options","shortseed","entropy","Uint8Array","crypto","msCrypto","getRandomValues","browser","plugins","screen","autoseed","arc4","prng","int32","quick","pass","is_math_call","state","initialize$2","propTypes","SHAPE","_typeof","ExpressionManager","fetch","frames","$bm_isInstanceOfArray","isNumerable","tOfV","$bm_neg","tOfA","lenA","retArr","easeInBez","easeOutBez","easeInOutBez","tOfB","lenB","sub","mul","mod","$bm_sum","$bm_sub","$bm_mul","$bm_div","$bm_mod","clamp","mm","radiansToDegrees","radians_to_degrees","degreesToRadians","degrees_to_radians","helperLengthArray","arr1","arr2","normalize","vec","rgbToHsl","hue2rgb","hslToRgb","linear","tMin","tMax","value1","value2","_tMin","rnd","createPath","inTangents","outTangents","inVertexPoint","outVertexPoint","arrPlaceholder","initiateExpression","noOp","_value","needsVelocity","_needsRandom","elemType","$bm_transform","thisProperty","loopIn","loop_in","loopOut","loop_out","smooth","fromCompToSurface","thisLayer","thisComp","scoped_bm_rt","expression_function","eval","wiggle","freq","amp","iWiggle","lenWiggle","addedAmps","periods","loopInDuration","loopOutDuration","velocity","textIndex","textTotal","selectorValue","lookAt","elem1","elem2","fVec","pitch","easeOut","val1","val2","applyEase","easeIn","ease","iKey","lenKey","nearestKey","obKey","framesToTime","fps","timeToFrames","seedrandom","randSeed","substring","posterizeTime","framesPerSecond","executeExpression","frameExpressionId","__preventDeadCodeRemoval","expressionHelpers","searchExpressions","speed","_cachingAtTime","getStaticValueAtTime","addPropertyDecorator","durationFlag","cycleDuration","firstKeyFrame","ret","lastKeyFrame","initV","endV","current","repeats","lastValue","nextLastValue","firstValue","nextFirstValue","samples","sampleValue","sampleFrequency","getTransformValueAtTime","_transformCachingAtTime","anchor","rotationZ","rotationY","rotationX","orientation","positionX","positionY","positionZ","getTransformStaticValueAtTime","propertyGetProp","ShapePropertyConstructorFunction","getConstructorFunction","KeyframedShapePropertyConstructorFunction","getKeyframedConstructorFunction","ShapeExpressions","isClosed","pointOnPath","_segmentsLength","accumulatedLength","initIndex","endIndex","vectorOnPath","vectorType","xLength","yLength","magnitude","tangentOnPath","normalOnPath","shapeValue","lastTime","propertyGetShapeProp","trims","initialize$1","addDecorator","getExpressionValue","calculateExpression","isKeyframed","hasExpressions","initialize","SVGComposableEffect","createMergeNode","resultId","ins","feMergeNode","feMerge","linearFilterValue","SVGTintFilter","linearFilter","matrixFilter","SVGFillFilter","SVGStrokeEffect","initialized","SVGTritoneFilter","feComponentTransfer","feFuncR","feFuncG","feFuncB","SVGProLevelsFilter","createFeFunc","feFuncA","feFuncRComposed","feFuncGComposed","feFuncBComposed","SVGDropShadowEffect","globalFilterSize","feGaussianBlur","feOffset","feFlood","feComposite","colorBlack","colorWhite","groupPath","elemChildren","childNodes","removeAttribute","pathMasker","dasharrayValue","getTotalLength","lineLength","units","color1","color2","color3","tableR","tableG","tableB","getTableValue","inputBlack","inputWhite","gamma","outputBlack","outputWhite","colorValue","table","outputDelta","inputDelta","col","_svgMatteSymbols","SVGMatte3Effect","filterElem","SVGGaussianBlurEffect","findSymbol","replaceInParent","symbolId","nextChild","useElem","setElementAsMask","symbol","sigma","dimensions","sigmaX","sigmaY","edgeMode","module"],"sourceRoot":""}